mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
now supports checks for exit codes and check for memory even when curl
returns (expected) exit code
This commit is contained in:
parent
1665435040
commit
0def60bf9d
@ -335,13 +335,41 @@ sub singletest {
|
||||
my $res = system("$CMDLINE");
|
||||
$res /= 256;
|
||||
|
||||
my $ERRORCODE = "$TESTDIR/error$NUMBER.txt";
|
||||
|
||||
if ($res != 0) {
|
||||
# the invoked command return an error code
|
||||
|
||||
my $expectederror=0;
|
||||
|
||||
if(-f $ERRORCODE) {
|
||||
open(ERRO, "<$ERRORCODE");
|
||||
$expectederror = <ERRO>;
|
||||
close(ERRO);
|
||||
# strip non-digits
|
||||
$expectederror =~ s/[^0-9]//g;
|
||||
}
|
||||
|
||||
if($expectederror != $res) {
|
||||
|
||||
print "*** Failed to invoke curl for test $NUMBER ***\n",
|
||||
"*** [$DESC] ***\n",
|
||||
"*** The command line was: ***\n $CMDLINE\n";
|
||||
"*** The command returned $res for: ***\n $CMDLINE\n";
|
||||
return 1;
|
||||
}
|
||||
elsif(!$short) {
|
||||
print " error OK";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(-f $ERRORCODE) {
|
||||
# this command was meant to fail, it didn't and thats WRONG
|
||||
if(!$short) {
|
||||
print " error FAILED";
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( -r "$VALIDOUT" ) {
|
||||
# verify redirected stdout
|
||||
$res = compare($STDOUT, $VALIDOUT, "data");
|
||||
@ -385,6 +413,7 @@ sub singletest {
|
||||
unlink($STDOUT);
|
||||
unlink($STDERR);
|
||||
|
||||
}
|
||||
if($memory_debug) {
|
||||
if(! -f $memdump) {
|
||||
print "\n** ALERT! memory debuggin without any output file?\n";
|
||||
@ -409,7 +438,6 @@ sub singletest {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($short) {
|
||||
print "OK";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user