aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-07-26 15:45:03 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-07-26 15:45:03 +0000
commit115dd6f09536784183aeb50f43f8995535a014e9 (patch)
tree2f609910e7ed50402d33f659848ed104c7262a36
parent0e03165467416b2637341ada829a9e16a003daa4 (diff)
Bertrand Demiddelaer made the testing work with valgrind 2.1
-rwxr-xr-xtests/runtests.pl13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index de7e6088c..526d331e6 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -75,6 +75,17 @@ my $memanalyze="./memanalyze.pl";
my $stunnel = checkcmd("stunnel");
my $valgrind = checkcmd("valgrind");
+
+my $valgrind_tool;
+if($valgrind) {
+ # since valgrind 2.1.x, '--tool' option is mandatory
+ # use it, if it is supported by the version installed on the system
+ system("valgrind --help 2>&1 | grep -- --tool > /dev/null 2>&1");
+ if (($? >> 8)==0) {
+ $valgrind_tool="--tool=memcheck ";
+ }
+}
+
my $gdb = checkcmd("gdb");
my $ssl_version; # set if libcurl is built with SSL support
@@ -1036,7 +1047,7 @@ sub singletest {
}
if($valgrind) {
- $CMDLINE = "valgrind --leak-check=yes --logfile=log/valgrind$testnum -q $CMDLINE";
+ $CMDLINE = "valgrind ".$valgrind_tool."--leak-check=yes --logfile=log/valgrind$testnum -q $CMDLINE";
}
$CMDLINE .= "$cmdargs >>$STDOUT 2>>$STDERR";