]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
my own system had a bad valgrind, so check that it works at least somewhat
authorDaniel Stenberg <daniel@haxx.se>
Fri, 31 Oct 2003 21:34:39 +0000 (21:34 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 31 Oct 2003 21:34:39 +0000 (21:34 +0000)
before we use it

tests/runtests.pl

index ffb713b579a3a77f09c5ae288558d54665e8f187..bca7d8d65c27baf3fb25fbf6c8e89ed91fcfa079 100755 (executable)
@@ -68,8 +68,16 @@ my @teststat;   # teststat[testnum]=reason, reasons for skip
 if($valgrind) {
     # we have found valgrind on the host, use it
 
-    # perhaps we should verify that valgrind works before we actually use it?
-    $CURL="valgrind --leak-check=yes --logfile-fd=3 -q $CURL";
+    # verify that we can invoke it fine
+    my $code = system("valgrind >/dev/null 2>&1");
+
+    if(($code>>8) != 1) {
+        #print "Valgrind failure, disable it\n";
+        undef $valgrind;
+    }
+    else {
+        $CURL="valgrind --leak-check=yes --logfile-fd=3 -q $CURL";
+    }
 }
 #######################################################################
 # variables the command line options may set