From: Daniel Stenberg Date: Tue, 8 Jun 2021 15:28:59 +0000 (+0200) Subject: runtests: skip disabled tests unless -f is used X-Git-Tag: curl-7_78_0~176 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76035e612a564530ad12205e37c3506d8778d9bd;p=thirdparty%2Fcurl.git runtests: skip disabled tests unless -f is used 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 --- diff --git a/tests/runtests.1 b/tests/runtests.1 index 8fadcfb98e..b99ecaf3f0 100644 --- a/tests/runtests.1 +++ b/tests/runtests.1 @@ -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 diff --git a/tests/runtests.pl b/tests/runtests.pl index ab77c0ab77..dd38ef4f1b 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -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; }