Newer
Older
}
if(($log =~ /^stderr\d+/) && ($log !~ /^stderr$testnum/)) {
next; # skip stderrNnn of other tests
}
if(($log =~ /^upload\d+/) && ($log !~ /^upload$testnum/)) {
next; # skip uploadNnn of other tests
}
if(($log =~ /^curl\d+\.out/) && ($log !~ /^curl$testnum\.out/)) {
next; # skip curlNnn.out of other tests
}
if(($log =~ /^test\d+\.txt/) && ($log !~ /^test$testnum\.txt/)) {
next; # skip testNnn.txt of other tests
Daniel Stenberg
committed
}
if(($log =~ /^file\d+\.txt/) && ($log !~ /^file$testnum\.txt/)) {
next; # skip fileNnn.txt of other tests
}
if(($log =~ /^valgrind\d+/) && ($log !~ /^valgrind$testnum/)) {
next; # skip valgrindNnn of other tests
}
logmsg "=== Start of file $log\n";
displaylogcontent("$LOGDIR/$log");
logmsg "=== End of file $log\n";
Daniel Stenberg
committed
}
}
#######################################################################
# The main test-loop
#
my $ok=0;
my $total=0;
my $lasttest;
my @at = split(" ", $TESTCASES);
$start = time();
foreach $testnum (@at) {
$lasttest = $testnum if($testnum > $lasttest);
$count++;
my $error = singletest($testnum, $count, scalar(@at));
if($error < 0) {
# not a test we can run
$total++; # number of tests we've run
if($error>0) {
Daniel Stenberg
committed
if($postmortem) {
# display all files in log/ in a nice way
displaylogs($testnum);
Daniel Stenberg
committed
}
if(!$anyway) {
# a test failed, abort
logmsg "\n - abort tests\n";
elsif(!$error) {
$ok++; # successful test counter
#######################################################################
# Close command log
#
# Tests done, stop the servers
unlink($SOCKSPIDFILE);
Daniel Stenberg
committed
my $all = $total + $skipped;
if($total) {
logmsg sprintf("TESTDONE: $ok tests out of $total reported OK: %d%%\n",
$ok/$total*100);
if($ok != $total) {
logmsg "TESTFAIL: These test cases failed: $failed\n";
}
else {
logmsg "TESTFAIL: No tests were performed\n";
Daniel Stenberg
committed
if($all) {
my $sofar = time()-$start;
logmsg "TESTDONE: $all tests were considered during $sofar seconds.\n";
Daniel Stenberg
committed
}
my $s=0;
logmsg "TESTINFO: $skipped tests were skipped due to these restraints:\n";
for(keys %skipped) {
my $r = $_;
Daniel Stenberg
committed
printf "TESTINFO: \"%s\" %d times (", $r, $skipped{$_};
# now show all test case numbers that had this reason for being
# skipped
my $c=0;
for(0 .. scalar @teststat) {
my $t = $_;
if($teststat[$_] eq $r) {
logmsg ", " if($c);
logmsg $_;
$c++;
}
}
}
Daniel Stenberg
committed
}
if($total && ($ok != $total)) {
exit 1;
}