#
my $short;
+my $automakestyle;
my $verbose;
my $debugprotocol;
my $anyway;
#
sub compare {
# filter off patterns _before_ this comparison!
- my ($subject, $firstref, $secondref)=@_;
+ my ($testnum, $testname, $subject, $firstref, $secondref)=@_;
my $result = compareparts($firstref, $secondref);
if($result) {
+ # timestamp test result verification end
+ $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
+
if(!$short) {
- logmsg "\n $subject FAILED:\n";
+ logmsg "\n $testnum: $subject FAILED:\n";
logmsg showdiff($LOGDIR, $firstref, $secondref);
}
- else {
+ elsif(!$automakestyle) {
logmsg "FAILED\n";
}
+ else {
+ # automakestyle
+ logmsg "FAIL: $testnum - $testname - $subject\n";
+ }
}
return $result;
}
timestampskippedevents($testnum);
return -1;
}
- logmsg sprintf("test %03d...", $testnum);
+ logmsg sprintf("test %03d...", $testnum) if(!$automakestyle);
# extract the reply data
my @reply = getpart("reply", "data");
# name of the test
my @testname= getpart("client", "name");
-
- if(!$short) {
- my $name = $testname[0];
- $name =~ s/\n//g;
- logmsg "[$name]\n";
- }
+ my $testname = $testname[0];
+ $testname =~ s/\n//g;
+ logmsg "[$testname]\n" if(!$short);
if($listonly) {
timestampskippedevents($testnum);
chomp($validstdout[$#validstdout]);
}
- $res = compare("stdout", \@actual, \@validstdout);
+ $res = compare($testnum, $testname, "stdout", \@actual, \@validstdout);
if($res) {
- # timestamp test result verification end
- $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
return 1;
}
$ok .= "s";
map s/\r\n/\n/g, @out;
}
- $res = compare("data", \@out, \@reply);
+ $res = compare($testnum, $testname, "data", \@out, \@reply);
if ($res) {
- # timestamp test result verification end
- $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
return 1;
}
$ok .= "d";
if(@upload) {
# verify uploaded data
my @out = loadarray("$LOGDIR/upload.$testnum");
- $res = compare("upload", \@out, \@upload);
+ $res = compare($testnum, $testname, "upload", \@out, \@upload);
if ($res) {
- # timestamp test result verification end
- $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
return 1;
}
$ok .= "u";
}
}
- $res = compare("protocol", \@out, \@protstrip);
+ $res = compare($testnum, $testname, "protocol", \@out, \@protstrip);
if($res) {
- # timestamp test result verification end
- $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
return 1;
}
}
}
- $res = compare("proxy", \@out, \@protstrip);
+ $res = compare($testnum, $testname, "proxy", \@out, \@protstrip);
if($res) {
- # timestamp test result verification end
- $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
return 1;
}
@outfile = fixarray(@outfile);
- $res = compare("output ($filename)", \@generated, \@outfile);
+ $res = compare($testnum, $testname, "output ($filename)",
+ \@generated, \@outfile);
if($res) {
- # timestamp test result verification end
- $timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
return 1;
}
}
my @e = valgrindparse($srcdir, $feature{'SSL'}, "$LOGDIR/$vgfile");
if(@e && $e[0]) {
- logmsg " valgrind ERROR ";
- logmsg @e;
+ if($automakestyle) {
+ logmsg "FAIL: $testnum - $testname - valgrind\n";
+ }
+ else {
+ logmsg " valgrind ERROR ";
+ logmsg @e;
+ }
# timestamp test result verification end
$timevrfyend{$testnum} = Time::HiRes::time() if($timestats);
return 1;
my $left=sprintf("remaining: %02d:%02d",
$estleft/60,
$estleft%60);
- logmsg sprintf("OK (%-3d out of %-3d, %s)\n", $count, $total, $left);
+
+ if(!$automakestyle) {
+ logmsg sprintf("OK (%-3d out of %-3d, %s)\n", $count, $total, $left);
+ }
+ else {
+ logmsg "PASS: $testnum - $testname\n";
+ }
# the test succeeded, remove all log files
if(!$keepoutfiles) {
# short output
$short=1;
}
+ elsif($ARGV[0] eq "-am") {
+ # automake-style output
+ $short=1;
+ $automakestyle=1;
+ }
elsif($ARGV[0] eq "-n") {
# no valgrind
undef $valgrind;
-r run time statistics
-rf full run time statistics
-s short output
+ -am automake style output PASS/FAIL: [number] [name]
-t[N] torture (simulate memory alloc failures); N means fail Nth alloc
-v verbose output
[num] like "5 6 9" or " 5 to 22 " to run those tests only