diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2024-06-12 11:08:39 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2024-06-18 13:20:32 +0100 |
commit | 9f0fb75b8e121a93b0f63dd823fa86ffd44e8e5d (patch) | |
tree | b4419583d8c06b014b1097d28680035f112640fa /libctf/testsuite/lib/ctf-lib.exp | |
parent | e3cd5660756223bbe4a2ab607ef019bbf5e9daf9 (diff) | |
download | binutils-9f0fb75b8e121a93b0f63dd823fa86ffd44e8e5d.zip binutils-9f0fb75b8e121a93b0f63dd823fa86ffd44e8e5d.tar.gz binutils-9f0fb75b8e121a93b0f63dd823fa86ffd44e8e5d.tar.bz2 |
libctf: suppress spurious failure of malloc-counting tests under valgrind
The libctf-regression/open-error-free.c test works by interposing malloc
and counting mallocs and frees across libctf operations. This only
works under suitably-interposable mallocs on systems supporting
dlsym (RTLD_NEXT, ...), so its operation is restricted to glibc
systems for now, but also it interacts badly with valgrind, which
interposes malloc itself. Detect a running valgrind and skip the test.
Add new facilities allowing libctf lookup tests to declare themselves
unsupported, by printing "UNSUPPORTED: " and then some meaningful
message instead of their normal output.
libctf/
* configure.ac: Check for <valgrind/valgrind.h>.
* config.h.in: Regenerate.
* configure: Likewise.
* testsuite/lib/ctf-lib.exp (run_lookup_test): Add support for
UNSUPPORTED tests.
* testsuite/libctf-regression/open-error-free.c: When running
under valgrind, this test is unsupported.
Diffstat (limited to 'libctf/testsuite/lib/ctf-lib.exp')
-rw-r--r-- | libctf/testsuite/lib/ctf-lib.exp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libctf/testsuite/lib/ctf-lib.exp b/libctf/testsuite/lib/ctf-lib.exp index eb2b738..cfd36be 100644 --- a/libctf/testsuite/lib/ctf-lib.exp +++ b/libctf/testsuite/lib/ctf-lib.exp @@ -270,6 +270,11 @@ proc run_lookup_test { name } { set results [run_host_cmd "$opts(wrapper) tmpdir/lookup" $lookup_output] } + if { [regexp {^UNSUPPORTED: (.*)$} $results -> reason] } { + unsupported "$testname: $reason" + return 0 + } + set f [open "tmpdir/lookup.out" "w"] puts $f $results close $f |