aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-03-12 12:58:30 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-03-12 12:58:30 +0000
commita23ac24192b12bc44c24cb58a4ea1dd33e621378 (patch)
treea4b8553e2c2e08d1ec4b2b2bdcd5029ef89d9fb7
parent9ee14644a79ad8aeb2fd006539ff8559a6d61d6f (diff)
made it support test case ranges on the command line, specified as
"X to Y", where X is smaller than Y.
-rwxr-xr-xtests/runtests.pl32
1 files changed, 27 insertions, 5 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 748ec7fb5..fa56d19d3 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -356,7 +356,7 @@ sub singletest {
if(! -r $CURLCMD) {
# this is not a test
print "$NUMBER doesn't look like a test case!\n";
- next;
+ return -1;
}
# remove previous server output logfile
@@ -567,6 +567,8 @@ sub singletest {
# Check options to this test program
#
+my $number=0;
+my $fromnum=-1;
my @testthis;
do {
if ($ARGV[0] eq "-v") {
@@ -605,7 +607,19 @@ EOHELP
exit;
}
elsif($ARGV[0] =~ /^(\d+)/) {
- push @testthis, $1;
+ $number = $1;
+ if($fromnum >= 0) {
+ for($fromnum .. $number) {
+ push @testthis, $_;
+ }
+ $fromnum = -1;
+ }
+ else {
+ push @testthis, $1;
+ }
+ }
+ elsif($ARGV[0] =~ /^to$/i) {
+ $fromnum = $number;
}
} while(shift @ARGV);
@@ -670,9 +684,12 @@ my $ok=0;
my $total=0;
foreach $testnum (split(" ", $TESTCASES)) {
- $total++;
my $error = singletest($testnum);
- if($error && !$anyway) {
+ if(-1 != $error) {
+ # valid test case number
+ $total++;
+ }
+ if(($error>0) && !$anyway) {
# a test failed, abort
print "\n - abort tests\n";
last;
@@ -696,4 +713,9 @@ close(CMDLOG);
stopserver($FTPPIDFILE);
stopserver($PIDFILE);
-print "$ok tests out of $total reported OK\n";
+if($total) {
+ print "$ok tests out of $total reported OK\n";
+}
+else {
+ print "No tests were performed!\n";
+}