Skip to content

Commit 73e0479

Browse files
committed
Improve failed test printer
1 parent 8e38c0e commit 73e0479

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

regression/failed-tests-printer.pl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@
44

55
open LOG,"<tests.log" or die "Failed to open tests.log\n";
66

7-
my $ignore = 1;
7+
my $printed_this_test = 1;
88
my $current_test = "";
99

1010
while (<LOG>) {
1111
chomp;
1212
if (/^Test '(.+)'/) {
1313
$current_test = $1;
14-
$ignore = 0;
15-
} elsif (1 == $ignore) {
16-
next;
14+
$printed_this_test = 0;
1715
} elsif (/\[FAILED\]\s*$/) {
18-
$ignore = 1;
19-
print "Failed test: $current_test\n";
20-
my $outf = `sed -n '2p' $current_test/test.desc`;
21-
$outf =~ s/\..*$/.out/;
22-
system("cat $current_test/$outf");
23-
print "\n\n";
16+
if(0 == $printed_this_test) {
17+
$printed_this_test = 1;
18+
print "\n\n";
19+
print "Failed test: $current_test\n";
20+
my $outf = `sed -n '2p' $current_test/test.desc`;
21+
$outf =~ s/\..*$/.out/;
22+
system("cat $current_test/$outf");
23+
print "\n\nFailed test.desc lines:\n";
24+
}
25+
print "$_\n";
2426
}
2527
}
2628

0 commit comments

Comments
 (0)