Skip to content

Commit 657ca67

Browse files
authored
Merge pull request #1177 from LAJW/test-gen-adapt-perl-script
Adapt perl script to handle multiple .desc files (test-gen-support edition)
2 parents 9552a29 + 710f615 commit 657ca67

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

regression/failed-tests-printer.pl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@
66

77
my $printed_this_test = 1;
88
my $current_test = "";
9+
my $output_file = "";
10+
my $descriptor_file = "";
911

1012
while (<LOG>) {
1113
chomp;
1214
if (/^Test '(.+)'/) {
1315
$current_test = $1;
1416
$printed_this_test = 0;
17+
} elsif (/Descriptor:\s+([^\s]+)/) {
18+
$descriptor_file = $1;
19+
} elsif (/Output:\s+([^\s]+)/) {
20+
$output_file = $1;
1521
} elsif (/\[FAILED\]\s*$/) {
1622
if(0 == $printed_this_test) {
1723
$printed_this_test = 1;
1824
print "\n\n";
1925
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";
26+
system("cat $current_test/$output_file");
27+
print "\n\nFailed $descriptor_file lines:\n";
2428
}
2529
print "$_\n";
2630
}

regression/test.pl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use subs;
44
use strict;
55
use warnings;
6+
use File::Basename;
67

78
use Cwd;
89

@@ -71,7 +72,8 @@ ($$$$$)
7172

7273
$options =~ s/$ign//g if(defined($ign));
7374

74-
my $output = $input;
75+
my $descriptor = basename($test);
76+
my $output = $descriptor;
7577
$output =~ s/\.[^.]*$/.out/;
7678

7779
if($output eq $input) {
@@ -82,6 +84,7 @@ ($$$$$)
8284
print LOG "Test '$name'\n";
8385
print LOG " Level: $level\n";
8486
print LOG " Input: $input\n";
87+
print LOG " Descriptor: $descriptor\n";
8588
print LOG " Output: $output\n";
8689
print LOG " Options: $options\n";
8790
print LOG " Results:\n";

0 commit comments

Comments
 (0)