mirror of
https://github.com/curl/curl.git
synced 2025-09-17 09:32:48 +03:00
Display "exit OK" when the exit code has been verified to be OK, and added
initial basic valgrind-log scan for memory leaks it could detect.
This commit is contained in:
parent
34be9df773
commit
6e118ce50f
|
@ -1195,24 +1195,22 @@ sub singletest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($errorcode || $cmdres) {
|
if($errorcode == $cmdres) {
|
||||||
if($errorcode == $cmdres) {
|
$errorcode =~ s/\n//;
|
||||||
$errorcode =~ s/\n//;
|
if($verbose) {
|
||||||
if($verbose) {
|
print " received exitcode $errorcode OK";
|
||||||
print " received errorcode $errorcode OK";
|
|
||||||
}
|
|
||||||
elsif(!$short) {
|
|
||||||
print " error OK";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
elsif(!$short) {
|
||||||
if(!$short) {
|
print " exit OK";
|
||||||
print "curl returned $cmdres, ".(0+$errorcode)." was expected\n";
|
|
||||||
}
|
|
||||||
print " error FAILED\n";
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if(!$short) {
|
||||||
|
print "curl returned $cmdres, ".(0+$errorcode)." was expected\n";
|
||||||
|
}
|
||||||
|
print " exit FAILED\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
# the test succeeded, remove all log files
|
# the test succeeded, remove all log files
|
||||||
if(!$keepoutfiles) {
|
if(!$keepoutfiles) {
|
||||||
|
@ -1259,6 +1257,37 @@ sub singletest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if($valgrind) {
|
||||||
|
opendir(DIR, "log") ||
|
||||||
|
return 0; # can't open log dir
|
||||||
|
my @files = readdir(DIR);
|
||||||
|
closedir DIR;
|
||||||
|
my $f;
|
||||||
|
my $l;
|
||||||
|
foreach $f (@files) {
|
||||||
|
if($f =~ /^valgrind$testnum/) {
|
||||||
|
$l = $f;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
my $leak;
|
||||||
|
open(VAL, "<$l");
|
||||||
|
while(<VAL>) {
|
||||||
|
if($_ =~ /definitely lost: (\d*) bytes/) {
|
||||||
|
$leak = $1;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(VAL);
|
||||||
|
if($leak) {
|
||||||
|
print " valgrind ERROR ";
|
||||||
|
}
|
||||||
|
elsif(!$short) {
|
||||||
|
print " valgrind OK";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if($short) {
|
if($short) {
|
||||||
print "OK";
|
print "OK";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user