From: Nick Alcock <nick.alcock@oracle.com>
To: binutils@sourceware.org
Subject: [PATCH 6/7] libctf: test: add wrapper
Date: Fri, 26 Apr 2024 21:20:22 +0100 [thread overview]
Message-ID: <20240426202023.423064-7-nick.alcock@oracle.com> (raw)
In-Reply-To: <20240426202023.423064-1-nick.alcock@oracle.com>
This .lk option lets you run the lookup program via a wrapper executable.
For example, to run under valgrind and check for leaks (albeit noisily
because of the libtool shell script wrapper):
libctf/
* testsuite/lib/ctf-lib.exp (run_lookup_test): Add wrapper.
---
libctf/testsuite/lib/ctf-lib.exp | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/libctf/testsuite/lib/ctf-lib.exp b/libctf/testsuite/lib/ctf-lib.exp
index 1f76e0b1aba..20bcf0c8bbe 100644
--- a/libctf/testsuite/lib/ctf-lib.exp
+++ b/libctf/testsuite/lib/ctf-lib.exp
@@ -112,6 +112,10 @@ proc compile_link_one_host_cc { src output additional_args } {
# host:
# If set, only run this test on hosts matching the given glob.
#
+# wrapper:
+# Wrap invocations of LOOKUP in this command. (Useful for valgrind
+# invocations, etc.)
+#
# Each option may occur at most once unless otherwise mentioned.
#
# After the option lines come regexp lines. run_lookup_test calls
@@ -151,6 +155,7 @@ proc run_lookup_test { name } {
set opts(xfail) {}
set opts(no_cross) {}
set opts(host) {}
+ set opts(wrapper) {}
foreach i $opt_array {
set opt_name [lindex $i 0]
@@ -257,9 +262,13 @@ proc run_lookup_test { name } {
}
}
- # Invoke the lookup program on the outputs.
+ # Invoke the lookup program on the outputs, possibly through the wrapper.
- set results [run_host_cmd tmpdir/lookup $lookup_output]
+ if { [llength $opts(wrapper)] == 0 } {
+ set results [run_host_cmd tmpdir/lookup $lookup_output]
+ } else {
+ set results [run_host_cmd "$opts(wrapper) tmpdir/lookup" $lookup_output]
+ }
set f [open "tmpdir/lookup.out" "w"]
puts $f $results
--
2.44.0.273.ge0bd14271f
next prev parent reply other threads:[~2024-04-26 20:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-26 20:20 [PATCH 0/7] libctf: leak-adjacent fixes Nick Alcock
2024-04-26 20:20 ` [PATCH 1/7] libctf: typos Nick Alcock
2024-04-26 20:20 ` [PATCH 2/7] libctf: failure to open parent dicts that exist should be an error Nick Alcock
2024-04-26 20:20 ` [PATCH 3/7] libctf: ctf_archive_iter: fix tiny leak Nick Alcock
2024-04-26 20:20 ` [PATCH 4/7] libctf: test: add lookup_link Nick Alcock
2024-04-26 20:20 ` [PATCH 5/7] libctf: test: add host Nick Alcock
2024-04-26 20:20 ` Nick Alcock [this message]
2024-04-26 20:20 ` [PATCH 7/7] libctf: fix leak of entire dict when dict opening fails Nick Alcock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240426202023.423064-7-nick.alcock@oracle.com \
--to=nick.alcock@oracle.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).