now counts all test cases and presents a counter at the end

This commit is contained in:
Daniel Stenberg 2000-11-28 12:49:39 +00:00
parent b2f0ca8a43
commit 0d7ba0ec61

View File

@ -346,6 +346,7 @@ sub singletest {
if(! -r $CURLCMD) { if(! -r $CURLCMD) {
# this is not a test # this is not a test
print "$NUMBER doesn't look like a test case!\n";
next; next;
} }
@ -606,7 +607,7 @@ runftpserver($verbose);
if ( $TESTCASES eq "all") { if ( $TESTCASES eq "all") {
# Get all commands and find out their test numbers # Get all commands and find out their test numbers
opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!"; opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!";
my @cmds = grep { /^command/ && -f "$TESTDIR/$_" } readdir(DIR); my @cmds = grep { /^command([0-9]+).txt/ && -f "$TESTDIR/$_" } readdir(DIR);
closedir DIR; closedir DIR;
$TESTCASES=""; # start with no test cases $TESTCASES=""; # start with no test cases
@ -632,13 +633,20 @@ open(CMDLOG, ">$CURLLOG") ||
# #
my $testnum; my $testnum;
my $ok=0;
my $total=0;
foreach $testnum (split(" ", $TESTCASES)) { foreach $testnum (split(" ", $TESTCASES)) {
if(singletest($testnum) && !$anyway) { $total++;
my $error = singletest($testnum);
if($error && !$anyway) {
# a test failed, abort # a test failed, abort
print "\n - abort tests\n"; print "\n - abort tests\n";
last; last;
} }
elsif(!$error) {
$ok++;
}
# loop for next test # loop for next test
} }
@ -655,3 +663,4 @@ close(CMDLOG);
stopserver($FTPPIDFILE); stopserver($FTPPIDFILE);
stopserver($PIDFILE); stopserver($PIDFILE);
print "$ok tests out of $total reported OK\n";