From a0550b54ab8d2cd6e6daf0ad3f4b697781d4a39f Mon Sep 17 00:00:00 2001 From: "Lukasz A.J. Wrona" Date: Thu, 13 Jul 2017 12:37:43 +0100 Subject: [PATCH] Adapt perl script to handle multiple .desc files Changes test.pl to name output *.out files after *.desc instead of *.class files. Also updates failed-test-printer.pl to work with those new *.out files and multiple *.desc files. --- regression/failed-tests-printer.pl | 12 ++++++++---- regression/test.pl | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/regression/failed-tests-printer.pl b/regression/failed-tests-printer.pl index 40767185d5c..aa5f28b5933 100755 --- a/regression/failed-tests-printer.pl +++ b/regression/failed-tests-printer.pl @@ -6,21 +6,25 @@ my $printed_this_test = 1; my $current_test = ""; +my $output_file = ""; +my $descriptor_file = ""; while () { chomp; if (/^Test '(.+)'/) { $current_test = $1; $printed_this_test = 0; + } elsif (/Descriptor:\s+([^\s]+)/) { + $descriptor_file = $1; + } elsif (/Output:\s+([^\s]+)/) { + $output_file = $1; } elsif (/\[FAILED\]\s*$/) { if(0 == $printed_this_test) { $printed_this_test = 1; print "\n\n"; print "Failed test: $current_test\n"; - my $outf = `sed -n '2p' $current_test/test.desc`; - $outf =~ s/\..*$/.out/; - system("cat $current_test/$outf"); - print "\n\nFailed test.desc lines:\n"; + system("cat $current_test/$output_file"); + print "\n\nFailed $descriptor_file lines:\n"; } print "$_\n"; } diff --git a/regression/test.pl b/regression/test.pl index 0bf364b86c3..be4762936a3 100755 --- a/regression/test.pl +++ b/regression/test.pl @@ -71,7 +71,9 @@ ($$$$$) $options =~ s/$ign//g if(defined($ign)); - my $output = $input; + my $descriptor = $test; + $descriptor =~ s/^.*\///; + my $output = $descriptor; $output =~ s/\.[^.]*$/.out/; if($output eq $input) { @@ -82,6 +84,7 @@ ($$$$$) print LOG "Test '$name'\n"; print LOG " Level: $level\n"; print LOG " Input: $input\n"; + print LOG " Descriptor: $descriptor\n"; print LOG " Output: $output\n"; print LOG " Options: $options\n"; print LOG " Results:\n";