]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: skip disabled tests unless -f is used
authorDaniel Stenberg <daniel@haxx.se>
Tue, 8 Jun 2021 15:28:59 +0000 (17:28 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 8 Jun 2021 21:35:37 +0000 (23:35 +0200)
To make it easier to write ranges like '115 to 229' without that
explicitly enabling tests that are listed in DISABLED, this makes
runtests always skip disabled tests unless the -f command line option is
used.

Previously the code attempted to not run such tests, but didn't do it
correctly.

Closes #7212

tests/runtests.1
tests/runtests.pl

index 8fadcfb98ed40a16a8baef6a4548f4de8e0a45d8..b99ecaf3f0af6ad30ef87318b6e8198a5f103c33 100644 (file)
@@ -72,6 +72,8 @@ The exclusion types are \fkeyword\fP, \ftest\fP, and \ftool\fP.
 Run the test event-based (if possible). This will make runtests invoke curl
 with --test-event option. This option only works if both curl and libcurl were
 built debug-enabled.
+.IP "-f"
+Force the test to run even if mentioned in DISABLED.
 .IP "-g"
 Run the given test(s) with gdb. This is best used on a single test case and
 curl built --disable-shared. This then fires up gdb with command line set to
index ab77c0ab776c2f7ce94cee7a2c51319eee3f6f11..dd38ef4f1b0381be171f2c9f5556daba038970cc 100755 (executable)
@@ -341,6 +341,7 @@ my $clearlocks;   # force removal of files by killing locking processes
 my $listonly;     # only list the tests
 my $postmortem;   # display detailed info about failed tests
 my $run_event_based; # run curl with --test-event to test the event API
+my $run_disabeled; # run the specific tests even if listed in DISABLED
 
 my %run;          # running server
 my %doesntrun;    # servers that don't work, identified by pidfile
@@ -3559,7 +3560,12 @@ sub singletest {
         logmsg "Warning: test$testnum not present in tests/data/Makefile.inc\n";
     }
     if($disabled{$testnum}) {
-        logmsg "Warning: test$testnum is explicitly disabled\n";
+        if(!$run_disabeled) {
+            $why = "listed in DISABLED";
+        }
+        else {
+            logmsg "Warning: test$testnum is explicitly disabled\n";
+        }
     }
     if($ignored{$testnum}) {
         logmsg "Warning: test$testnum result is ignored\n";
@@ -5401,6 +5407,10 @@ while(@ARGV) {
         # run the tests cases event based if possible
         $run_event_based=1;
     }
+    elsif($ARGV[0] eq "-f") {
+        # force - run the test case even if listed in DISABLED
+        $run_disabeled=1;
+    }
     elsif($ARGV[0] eq "-E") {
         # load additional reasons to skip tests
         shift @ARGV;
@@ -5548,6 +5558,7 @@ Usage: runtests.pl [options] [test selection(s)]
   -d       display server debug info
   -e       event-based execution
   -E file  load the specified file to exclude certain tests
+  -f       forcibly run even if disabled
   -g       run the test case with gdb
   -gw      run the test case with gdb as a windowed application
   -h       this help text
@@ -5582,16 +5593,7 @@ EOHELP
         $number = $1;
         if($fromnum >= 0) {
             for my $n ($fromnum .. $number) {
-                if($disabled{$n}) {
-                    # skip disabled test cases
-                    my $why = "configured as DISABLED";
-                    $skipped++;
-                    $skipped{$why}++;
-                    $teststat[$n]=$why; # store reason for this test case
-                }
-                else {
-                    push @testthis, $n;
-                }
+                push @testthis, $n;
             }
             $fromnum = -1;
         }