[prev in list] [next in list] [prev in thread] [next in thread] 

List:       curl-commits
Subject:    cvs: curl /tests runtests.pl
From:       "Daniel Stenberg" <bagder () php ! net>
Date:       2003-12-17 15:33:05
[Download RAW message or body]

bagder		Wed Dec 17 10:33:05 2003 EDT

  Modified files:              
    /curl/tests	runtests.pl 
  Log:
  Check the error code AFTER the protocol and data. Only changed to perhaps
  get some further input on the notorious test case 91 failures!
  
  
Index: curl/tests/runtests.pl
diff -u curl/tests/runtests.pl:1.102 curl/tests/runtests.pl:1.103
--- curl/tests/runtests.pl:1.102	Mon Nov 24 02:17:16 2003
+++ curl/tests/runtests.pl	Wed Dec 17 10:33:04 2003
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# $Id: runtests.pl,v 1.102 2003/11/24 07:17:16 bagder Exp $
+# $Id: runtests.pl,v 1.103 2003/12/17 15:33:04 bagder Exp $
 #
 # Main curl test script, in perl to run on more platforms
 #
@@ -925,7 +925,7 @@
 
     print CMDLOG "$CMDLINE\n";
 
-    my $res;
+    my $cmdres;
     # run the command line we built
     if($gdbthis) {
         open(GDBCMD, ">log/gdbcmd");
@@ -933,18 +933,18 @@
         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 @@
     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 @@
         }        
     }
 
+    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);




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic