aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-12-17 15:33:04 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-12-17 15:33:04 +0000
commita3ad4295c9707665b2418aec09228ada40ffbd64 (patch)
treed28a8904dab29b3d02ebca35b99f9152ca8fc080 /tests
parent2450506c8398fc6652558122b1f5a3ba1f2e79cc (diff)
Check the error code AFTER the protocol and data. Only changed to perhaps
get some further input on the notorious test case 91 failures!
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.pl53
1 files changed, 27 insertions, 26 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 2fdcf603a..c12ca4062 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -925,7 +925,7 @@ sub singletest {
print CMDLOG "$CMDLINE\n";
- my $res;
+ my $cmdres;
# run the command line we built
if($gdbthis) {
open(GDBCMD, ">log/gdbcmd");
@@ -933,18 +933,18 @@ sub singletest {
print GDBCMD "show args\n";
close(GDBCMD);
system("gdb --directory libtest $DBGCURL -x log/gdbcmd");
- $res =0; # makes it always continue after a debugged run
+ $cmdres=0; # makes it always continue after a debugged run
}
else {
- $res = system("$CMDLINE");
- my $signal_num = $res & 127;
- my $dumped_core = $res & 128;
+ $cmdres = system("$CMDLINE");
+ my $signal_num = $cmdres & 127;
+ my $dumped_core = $cmdres & 128;
if(!$anyway && ($signal_num || $dumped_core)) {
- $res = 1000;
+ $cmdres = 1000;
}
else {
- $res /= 256;
+ $cmdres /= 256;
}
}
@@ -959,25 +959,7 @@ sub singletest {
my @err = getpart("verify", "errorcode");
my $errorcode = $err[0];
- if($errorcode || $res) {
- if($errorcode == $res) {
- $errorcode =~ s/\n//;
- if($verbose) {
- print " received errorcode $errorcode OK";
- }
- elsif(!$short) {
- print " error OK";
- }
- }
- else {
- if(!$short) {
- print "curl returned $res, ".(0+$errorcode)." was expected\n";
- }
- print " error FAILED\n";
- return 1;
- }
- }
-
+ my $res;
if (@validstdout) {
# verify redirected stdout
my @actual = loadarray($STDOUT);
@@ -1070,6 +1052,25 @@ sub singletest {
}
}
+ if($errorcode || $cmdres) {
+ if($errorcode == $cmdres) {
+ $errorcode =~ s/\n//;
+ if($verbose) {
+ print " received errorcode $errorcode OK";
+ }
+ elsif(!$short) {
+ print " error OK";
+ }
+ }
+ else {
+ if(!$short) {
+ print "curl returned $cmdres, ".(0+$errorcode)." was expected\n";
+ }
+ print " error FAILED\n";
+ return 1;
+ }
+ }
+
if(!$keepoutfiles) {
# remove the stdout and stderr files
unlink($STDOUT);