Added support in runtests.pl for "!n" test numbers to disable individual tests.

This commit is contained in:
Dan Fandrich 2007-04-25 23:18:52 +00:00
parent 6e835ef3aa
commit f213d0db98
3 changed files with 20 additions and 8 deletions

View File

@ -6,6 +6,11 @@
Changelog 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) Daniel S (25 April 2007)
- Sonia Subramanian brought our attention to a problem that happens if you set - 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 the CURLOPT_RESUME_FROM or CURLOPT_RANGE options and an existing connection

View File

@ -34,14 +34,15 @@ Run:
variables of that script in case you have some specific needs. 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 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 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 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 (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 ranges with 'to', as in "./runtests 3 to 9" which runs the seven tests from
3 to 9. 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: Memory:
The test script will check that all allocated memory is freed properly IF The test script will check that all allocated memory is freed properly IF

View File

@ -2247,6 +2247,7 @@ sub serverfortest {
my $number=0; my $number=0;
my $fromnum=-1; my $fromnum=-1;
my @testthis; my @testthis;
my %disabled;
do { do {
if ($ARGV[0] eq "-v") { if ($ARGV[0] eq "-v") {
# verbose output # verbose output
@ -2321,6 +2322,7 @@ Usage: runtests.pl [options]
-t torture -t torture
-v verbose output -v verbose output
[num] like "5 6 9" or " 5 to 22 " to run those tests only [num] like "5 6 9" or " 5 to 22 " to run those tests only
![num] like "!5 !6 !9" to disable those tests
EOHELP EOHELP
; ;
exit; exit;
@ -2340,6 +2342,10 @@ EOHELP
elsif($ARGV[0] =~ /^to$/i) { elsif($ARGV[0] =~ /^to$/i) {
$fromnum = $number+1; $fromnum = $number+1;
} }
elsif($ARGV[0] =~ /^!(\d+)/) {
$fromnum = -1;
$disabled{$1}=$1;
}
} while(shift @ARGV); } while(shift @ARGV);
if($testthis[0] ne "") { if($testthis[0] ne "") {
@ -2406,7 +2412,6 @@ if ( $TESTCASES eq "all") {
my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR); my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
closedir DIR; closedir DIR;
my %dis;
open(D, "$TESTDIR/DISABLED"); open(D, "$TESTDIR/DISABLED");
while(<D>) { while(<D>) {
if(/^ *\#/) { if(/^ *\#/) {
@ -2414,9 +2419,10 @@ if ( $TESTCASES eq "all") {
next; next;
} }
if($_ =~ /(\d+)/) { if($_ =~ /(\d+)/) {
$dis{$1}=$1; # disable this test number $disabled{$1}=$1; # disable this test number
} }
} }
close(D);
$TESTCASES=""; # start with no test cases $TESTCASES=""; # start with no test cases
@ -2426,9 +2432,9 @@ if ( $TESTCASES eq "all") {
} }
# the the numbers from low to high # the the numbers from low to high
foreach my $n (sort { $a <=> $b } @cmds) { foreach my $n (sort { $a <=> $b } @cmds) {
if($dis{$n}) { if($disabled{$n}) {
# skip disabled test cases # skip disabled test cases
my $why = "mentioned in DISABLED"; my $why = "configured as DISABLED";
$skipped++; $skipped++;
$skipped{$why}++; $skipped{$why}++;
$teststat[$n]=$why; # store reason for this test case $teststat[$n]=$why; # store reason for this test case