From 424a8882fbfea76479469034157a1ed48404e010 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 18 Jan 2010 14:49:31 +0000 Subject: fix warnings --- tests/runtests.pl | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/runtests.pl b/tests/runtests.pl index a3240eac8..ce3fddaac 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -2359,9 +2359,18 @@ sub singletest { $DBGCURL=$CMDLINE; } - my $usevalgrind = $valgrind && ((getpart("verify", "valgrind"))[0] !~ /disable/); - if($usevalgrind) { - $CMDLINE = "$valgrind ".$valgrind_tool."--leak-check=yes --num-callers=16 ${valgrind_logfile}=$LOGDIR/valgrind$testnum $CMDLINE"; + my $usevalgrind; + if($valgrind) { + my @valgrindoption = getpart("verify", "valgrind"); + if((!@valgrindoption) || ($valgrindoption[0] !~ /disable/)) { + $usevalgrind = 1; + my $valgrindcmd = "$valgrind "; + $valgrindcmd .= "$valgrind_tool " if($valgrind_tool); + $valgrindcmd .= "--leak-check=yes "; + $valgrindcmd .= "--num-callers=16 "; + $valgrindcmd .= "${valgrind_logfile}=$LOGDIR/valgrind$testnum"; + $CMDLINE = "$valgrindcmd $CMDLINE"; + } } $CMDLINE .= "$cmdargs >>$STDOUT 2>>$STDERR"; @@ -2823,7 +2832,7 @@ sub singletest { my $f; my $l; foreach $f (@files) { - if($f =~ /^valgrind$testnum\.pid/) { + if($f =~ /^valgrind$testnum\./) { $l = $f; last; } @@ -3461,7 +3470,7 @@ if($valgrind) { # use it, if it is supported by the version installed on the system runclient("valgrind --help 2>&1 | grep -- --tool > /dev/null 2>&1"); if (($? >> 8)==0) { - $valgrind_tool="--tool=memcheck "; + $valgrind_tool="--tool=memcheck"; } open(C, "<$CURL"); my $l = ; @@ -3476,8 +3485,11 @@ if($valgrind) { # cut off all but digits and dots $ver =~ s/[^0-9.]//g; - if($ver >= 3) { - $valgrind_logfile="--log-file"; + if($ver =~ /^(\d+)/) { + $ver = $1; + if($ver >= 3) { + $valgrind_logfile="--log-file"; + } } } } @@ -3658,7 +3670,7 @@ sub displaylogs { if(($log =~ /^file\d+\.txt/) && ($log !~ /^file$testnum\.txt/)) { next; # skip fileNnn.txt of other tests } - if(($log =~ /^valgrind\d+/) && ($log !~ /^valgrind$testnum/)) { + if(($log =~ /^valgrind\d+/) && ($log !~ /^valgrind$testnum\./)) { next; # skip valgrindNnn of other tests } logmsg "=== Start of file $log\n"; -- cgit v1.2.3