print map ("$_\n", @overall, @divider, @summary, @divider, @rubrics);
for my $test (@failures) {
- open (RESULT, '<', "$test.result") or next;
print map ("$_\n", @divider);
print "DETAILS OF $test FAILURE:\n\n";
- my $first_line = <RESULT>;
- my ($cnt) = 0;
- while (<RESULT>) {
- print;
- $cnt++;
+
+ if (open (RESULT, '<', "$test.result")) {
+ my $first_line = <RESULT>;
+ my ($cnt) = 0;
+ while (<RESULT>) {
+ print;
+ $cnt++;
+ }
+ close (RESULT);
}
- close (RESULT);
- if ($cnt == 0) {
- open (OUTPUT, '<', "$test.output") or next;
+ if (open (OUTPUT, '<', "$test.output")) {
+ print "\nOUTPUT FROM $test:\n\n";
+
my ($panics) = 0;
while (<OUTPUT>) {
if (/PANIC/ && ++$panics > 2) {
close (OUTPUT);
}
}
-
}
die "unknown option " . (keys (%options))[0] . "\n" if %options;
- my ($msg) = "Actual output:\n" . join ('', map (" $_\n", @output));
+ my ($msg);
# Compare actual output against each allowed output.
foreach my $exp_string (@$expected) {
my (@expected) = split ("\n", $exp_string);
- $msg .= "\nAcceptable output:\n";
+ $msg .= "Acceptable output:\n";
$msg .= join ('', map (" $_\n", @expected));
# Check whether actual and expected match.