From 1d7ee2d5532918c953a339ec11f0624a1beb2604 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 14 Jan 2017 15:32:41 -0800 Subject: [PATCH] tests: skip valgrind-running tests when ASAN-enabled * init.cfg (require_valgrind_): Skip when we detect that the binary is ASAN-enabled. --- init.cfg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.cfg b/init.cfg index 25c68d6..915a260 100644 --- a/init.cfg +++ b/init.cfg @@ -23,10 +23,17 @@ stderr_fileno_=9 # which could happen if not installed, # or hasn't support for the built architecture, # or hasn't appropriate error suppressions installed etc. +# or the program under test was compiled with address sanitizer. require_valgrind_() { valgrind --error-exitcode=1 true 2>/dev/null || skip_ "requires a working valgrind" + + # We cannot apply valgrind to an ASAN-enabled executable. + # An ASAN-enabled binary will print this on the first line of + # its help output: Available flags for AddressSanitizer: + ASAN_OPTIONS=help=1 sed qq 2>&1 | grep AddressSanitizer: \ + && skip_ 'ASAN enabled binary cannot work with valgrind' } # Call this with a list of programs under test immediately after -- 2.9.3