]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Added support in runtests.pl for "!n" test numbers to disable individual tests.
authorDan Fandrich <dan@coneharvesters.com>
Wed, 25 Apr 2007 23:18:52 +0000 (23:18 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Wed, 25 Apr 2007 23:18:52 +0000 (23:18 +0000)
CHANGES
tests/README
tests/runtests.pl

diff --git a/CHANGES b/CHANGES
index 56f07bd75bd8ed53fcb5d08a2bbd6bfd898e637f..0d458b04150fcb175041e35d576c459884c252b3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,11 @@
 
                                   Changelog
 
+Dan F (25 April 2007)
+- Added support in runtests.pl for "!n" test numbers to disable individual
+  tests.  Changed -t to only keep log files around when -k is specified,
+  to have the same behaviour as without -t.
+
 Daniel S (25 April 2007)
 - Sonia Subramanian brought our attention to a problem that happens if you set
   the CURLOPT_RESUME_FROM or CURLOPT_RANGE options and an existing connection
index c9523a3827a22a811b719ce7515a33049bb6a7d0..56ebab9528e7430e7f1c73ec6ed151a6c7b8e74d 100644 (file)
@@ -34,14 +34,15 @@ Run:
   variables of that script in case you have some specific needs.
 
   The script breaks on the first test that doesn't do OK. Use -a to prevent
-  the script to abort on the first error. Run the script with -v for more
+  the script from abort on the first error. Run the script with -v for more
   verbose output. Use -d to run the test servers with debug output enabled as
-  well.
+  well. Specifying -k keeps all the log files generated by the test intact.
 
   Use -s for shorter output, or pass test numbers to run specific tests only
   (like "./runtests.pl 3 4" to test 3 and 4 only). It also supports test case
-  ranges with 'to'. As in "./runtests 3 to 9" which runs the seven tests from
-  3 to 9.
+  ranges with 'to', as in "./runtests 3 to 9" which runs the seven tests from
+  3 to 9. Any test numbers starting with ! are disabled, as are any test
+  numbers found in the file data/DISABLED (one per line).
 
 Memory:
   The test script will check that all allocated memory is freed properly IF
index b1143800054fdeda074f12a7b127eb7567f0f0c5..851de6f5aae3f73be02f6647bbaa4329bc2d968b 100755 (executable)
@@ -2247,6 +2247,7 @@ sub serverfortest {
 my $number=0;
 my $fromnum=-1;
 my @testthis;
+my %disabled;
 do {
     if ($ARGV[0] eq "-v") {
         # verbose output
@@ -2321,6 +2322,7 @@ Usage: runtests.pl [options]
   -t       torture
   -v       verbose output
   [num]    like "5 6 9" or " 5 to 22 " to run those tests only
+  ![num]   like "!5 !6 !9" to disable those tests
 EOHELP
     ;
         exit;
@@ -2340,6 +2342,10 @@ EOHELP
     elsif($ARGV[0] =~ /^to$/i) {
         $fromnum = $number+1;
     }
+    elsif($ARGV[0] =~ /^!(\d+)/) {
+        $fromnum = -1;
+        $disabled{$1}=$1;
+    }
 } while(shift @ARGV);
 
 if($testthis[0] ne "") {
@@ -2406,7 +2412,6 @@ if ( $TESTCASES eq "all") {
     my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
     closedir DIR;
 
-    my %dis;
     open(D, "$TESTDIR/DISABLED");
     while(<D>) {
         if(/^ *\#/) {
@@ -2414,9 +2419,10 @@ if ( $TESTCASES eq "all") {
             next;
         }
         if($_ =~ /(\d+)/) {
-            $dis{$1}=$1; # disable this test number
+            $disabled{$1}=$1; # disable this test number
         }
     }
+    close(D);
 
     $TESTCASES=""; # start with no test cases
 
@@ -2426,9 +2432,9 @@ if ( $TESTCASES eq "all") {
     }
     # the the numbers from low to high
     foreach my $n (sort { $a <=> $b } @cmds) {
-        if($dis{$n}) {
+        if($disabled{$n}) {
             # skip disabled test cases
-            my $why = "mentioned in DISABLED";
+            my $why = "configured as DISABLED";
             $skipped++;
             $skipped{$why}++;
             $teststat[$n]=$why; # store reason for this test case