1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 16:18:48 -05:00

fix warnings

This commit is contained in:
Yang Tse 2010-01-18 14:49:31 +00:00
parent 3fdced357b
commit 424a8882fb

View File

@ -2359,9 +2359,18 @@ sub singletest {
$DBGCURL=$CMDLINE; $DBGCURL=$CMDLINE;
} }
my $usevalgrind = $valgrind && ((getpart("verify", "valgrind"))[0] !~ /disable/); my $usevalgrind;
if($usevalgrind) { if($valgrind) {
$CMDLINE = "$valgrind ".$valgrind_tool."--leak-check=yes --num-callers=16 ${valgrind_logfile}=$LOGDIR/valgrind$testnum $CMDLINE"; 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"; $CMDLINE .= "$cmdargs >>$STDOUT 2>>$STDERR";
@ -2823,7 +2832,7 @@ sub singletest {
my $f; my $f;
my $l; my $l;
foreach $f (@files) { foreach $f (@files) {
if($f =~ /^valgrind$testnum\.pid/) { if($f =~ /^valgrind$testnum\./) {
$l = $f; $l = $f;
last; last;
} }
@ -3461,7 +3470,7 @@ if($valgrind) {
# use it, if it is supported by the version installed on the system # use it, if it is supported by the version installed on the system
runclient("valgrind --help 2>&1 | grep -- --tool > /dev/null 2>&1"); runclient("valgrind --help 2>&1 | grep -- --tool > /dev/null 2>&1");
if (($? >> 8)==0) { if (($? >> 8)==0) {
$valgrind_tool="--tool=memcheck "; $valgrind_tool="--tool=memcheck";
} }
open(C, "<$CURL"); open(C, "<$CURL");
my $l = <C>; my $l = <C>;
@ -3476,8 +3485,11 @@ if($valgrind) {
# cut off all but digits and dots # cut off all but digits and dots
$ver =~ s/[^0-9.]//g; $ver =~ s/[^0-9.]//g;
if($ver >= 3) { if($ver =~ /^(\d+)/) {
$valgrind_logfile="--log-file"; $ver = $1;
if($ver >= 3) {
$valgrind_logfile="--log-file";
}
} }
} }
} }
@ -3658,7 +3670,7 @@ sub displaylogs {
if(($log =~ /^file\d+\.txt/) && ($log !~ /^file$testnum\.txt/)) { if(($log =~ /^file\d+\.txt/) && ($log !~ /^file$testnum\.txt/)) {
next; # skip fileNnn.txt of other tests 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 next; # skip valgrindNnn of other tests
} }
logmsg "=== Start of file $log\n"; logmsg "=== Start of file $log\n";