tests: avoid false positive valgrind failures
authorPádraig Brady <P@draigBrady.com>
Thu, 20 Dec 2012 00:09:15 +0000 (00:09 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 21 Dec 2012 15:57:25 +0000 (15:57 +0000)
* init.cfg (require_valgrind_): Check the `true` program,
which will check more valgrind failure cases as now
detailed in the function comments.

init.cfg

index e853b0a..ce5a106 100644 (file)
--- a/init.cfg
+++ b/init.cfg
@@ -159,10 +159,14 @@ require_strace_()
   fi
 }
 
-# Skip the current test if valgrind doesn't work.
+# Skip the current test if valgrind doesn't work,
+# which could happen if not installed,
+# or hasn't support for the built architecture,
+# or hasn't appropriate error suppressions installed etc.
 require_valgrind_()
 {
-  valgrind --help >/dev/null || skip_ "requires valgrind"
+  valgrind --error-exitcode=1 true 2>/dev/null ||
+    skip_ "requires a working valgrind"
 }
 
 require_setfacl_()