blob: 6fb37b1886c7d5ec7fca071b208e532a82dbbe45 [file] [log] [blame]
Christophe Lyonbff39612015-11-18 16:29:11 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4
5use File::Glob;
6use Getopt::Long;
7use Term::ANSIColor qw(:constants);
8use File::Basename;
9use Cwd;
10
11my $app = $0;
12
13sub read_sum($);
14sub read_unstable($);
15sub dump_result($);
16sub compare_results($$);
17sub usage();
18sub print_compare_results_summary($$);
19sub nothing($$$$);
20
Christophe Lyondded4d82016-06-28 18:12:38 +020021my $PASS_PASS = "Still passes [PASS => PASS]";
Christophe Lyondded4d82016-06-28 18:12:38 +020022my $PASS_XPASS = "PASS now XPASS [PASS =>XPASS]";
23my $PASS_FAIL = "PASS now FAIL [PASS => FAIL]";
Christophe Lyon71cec962016-06-28 18:27:30 +020024my $PASS_XFAIL = "PASS now XFAIL [PASS =>XFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020025my $PASS_UNSUPPORTED = "PASS now UNSUPPORTED [PASS =>UNSUP]";
26my $PASS_UNRESOLVED = "PASS now UNRESOLVED [PASS =>UNRES]";
27my $PASS_UNTESTED = "PASS now UNTESTED [PASS =>UNTES]";
Christophe Lyona140aa82015-12-17 22:53:03 +010028my $PASS_DISAPPEARS = "PASS disappears [PASS => ]";
Christophe Lyon71cec962016-06-28 18:27:30 +020029my $PASS_APPEARS = "New PASS [ => PASS]";
30my $PASSED_NOW_TIMEOUTS = "Timeout [PASS =>T.OUT]";
31
32my $XPASS_PASS = "XPASS now PASS [XPASS=> PASS]";
33my $XPASS_XPASS = "Still xpass [XPASS=>XPASS]";
Christophe Lyondded4d82016-06-28 18:12:38 +020034my $XPASS_FAIL = "XPASS now FAIL [XPASS=> FAIL]";
Christophe Lyon71cec962016-06-28 18:27:30 +020035my $XPASS_XFAIL = "XPASS now XFAIL [XPASS=>XFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020036my $XPASS_UNSUPPORTED = "XPASS now UNSUPPORTED [XPASS=>UNSUP]";
37my $XPASS_UNRESOLVED = "XPASS now UNRESOLVED [XPASS=>UNRES]";
38my $XPASS_UNTESTED = "XPASS now UNTESTED [XPASS=>UNTES]";
Christophe Lyon71cec962016-06-28 18:27:30 +020039my $XPASS_DISAPPEARS = "XPASS disappears [XPASS=> ]";
40my $XPASS_APPEARS = "XPASS appears [ =>XPASS]";
41
42my $FAIL_PASS = "FAIL now PASS [FAIL => PASS]";
43my $FAIL_XPASS = "FAIL now XPASS [FAIL =>XPASS]";
44my $FAIL_FAIL = "Still fails [FAIL => FAIL]";
45my $FAIL_XFAIL = "FAIL now XFAIL [FAIL =>XFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020046my $FAIL_UNSUPPORTED = "FAIL now UNSUPPORTED [FAIL =>UNSUP]";
47my $FAIL_UNRESOLVED = "FAIL now UNRESOLVED [FAIL =>UNRES]";
48my $FAIL_UNTESTED = "FAIL now UNTESTED [FAIL =>UNTES]";
Christophe Lyon71cec962016-06-28 18:27:30 +020049my $FAIL_DISAPPEARS = "FAIL disappears [FAIL => ]";
50my $FAIL_APPEARS = "FAIL appears [ => FAIL]";
51
52my $XFAIL_PASS = "XFAIL now PASS [XFAIL=> PASS]";
53my $XFAIL_XPASS = "XFAIL now XPASS [XFAIL=>XPASS]";
Christophe Lyondded4d82016-06-28 18:12:38 +020054my $XFAIL_FAIL = "XFAIL now FAIL [XFAIL=> FAIL]";
Christophe Lyon71cec962016-06-28 18:27:30 +020055my $XFAIL_XFAIL = "Still xfail [XFAIL=>XFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020056my $XFAIL_UNSUPPORTED = "XFAIL now UNSUPPORTED [XFAIL=>UNSUP]";
57my $XFAIL_UNRESOLVED = "XFAIL now UNRESOLVED [XFAIL=>UNRES]";
58my $XFAIL_UNTESTED = "XFAIL now UNTESTED [XFAIL=>UNTES]";
Christophe Lyona140aa82015-12-17 22:53:03 +010059my $XFAIL_DISAPPEARS = "XFAIL disappears [XFAIL=> ]";
Christophe Lyon71cec962016-06-28 18:27:30 +020060my $XFAIL_APPEARS = "XFAIL appears [ =>XFAIL]";
Christophe Lyona140aa82015-12-17 22:53:03 +010061
62my $UNSUPPORTED_PASS = "UNSUPPORTED now PASS [UNSUP=> PASS]";
Christophe Lyon71cec962016-06-28 18:27:30 +020063my $UNSUPPORTED_XPASS = "UNSUPPORTED now XPASS [UNSUP=>XPASS]";
Christophe Lyona140aa82015-12-17 22:53:03 +010064my $UNSUPPORTED_FAIL = "UNSUPPORTED now FAIL [UNSUP=> FAIL]";
Christophe Lyon71cec962016-06-28 18:27:30 +020065my $UNSUPPORTED_XFAIL = "UNSUPPORTED now XFAIL [UNSUP=>XFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020066my $UNSUPPORTED_UNSUPPORTED= "UNSUPP now UNSUPP [UNSUP=>UNSUP]";
67my $UNSUPPORTED_UNRESOLVED= "UNSUPP now UNRESOLVED [UNSUP=>UNRES]";
68my $UNSUPPORTED_UNTESTED = "UNSUPP now UNTESTED [UNSUP=>UNTES]";
Christophe Lyon71cec962016-06-28 18:27:30 +020069my $UNSUPPORTED_DISAPPEARS= "UNSUPPORTED disappears [UNSUP=> ]";
70my $UNSUPPORTED_APPEARS = "UNSUPPORTED appears [ =>UNSUP]";
71
72my $UNTESTED_PASS = "UNTESTED now PASS [UNTES=> PASS]";
Christophe Lyona140aa82015-12-17 22:53:03 +010073my $UNTESTED_XPASS = "UNTESTED now XPASS [UNTES=>XPASS]";
Christophe Lyon71cec962016-06-28 18:27:30 +020074my $UNTESTED_FAIL = "UNTESTED now FAIL [UNTES=> FAIL]";
75my $UNTESTED_XFAIL = "UNTESTED now XFAIL [UNTES=>XFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020076my $UNTESTED_UNSUPPORTED = "UNTESTED now UNSUPP [UNTES=>UNSUP]";
77my $UNTESTED_UNRESOLVED = "UNTESTED now UNRESOLVED [UNTES=>UNRES]";
78my $UNTESTED_UNTESTED = "UNTESTED now UNTESTED [UNTES=>UNTES]";
Christophe Lyon71cec962016-06-28 18:27:30 +020079my $UNTESTED_DISAPPEARS = "UNTESTED disappears [UNTES=> ]";
80my $UNTESTED_APPEARS = "UNTESTED appears [ =>UNTES]";
81
82my $UNRESOLVED_PASS = "UNRESOLVED now PASS [UNRES=> PASS]";
Christophe Lyona140aa82015-12-17 22:53:03 +010083my $UNRESOLVED_XPASS = "UNRESOLVED now XPASS [UNRES=>XPASS]";
Christophe Lyon71cec962016-06-28 18:27:30 +020084my $UNRESOLVED_FAIL = "UNRESOLVED now FAIL [UNRES=> FAIL]";
85my $UNRESOLVED_XFAIL = "UNRESOLVED now XFAIL [UNRES=>XFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020086my $UNRESOLVED_UNSUPPORTED= "UNRESOLVED now UNSUPP [UNRES=>UNSUP]";
87my $UNRESOLVED_UNRESOLVED = "UNRESOLVED now UNRESOLVED [UNRES=>UNRES]";
88my $UNRESOLVED_UNTESTED = "UNRESOLVED now UNTESTED [UNRES=>UNTES]";
Christophe Lyon71cec962016-06-28 18:27:30 +020089my $UNRESOLVED_DISAPPEARS = "UNRESOLVED disappears [UNRES=> ]";
90my $UNRESOLVED_APPEARS = "UNRESOLVED appears [ =>UNRES]";
91
Christophe Lyonbcbd7482016-09-19 14:54:50 +020092my $ERROR_DISAPPEARS = "ERROR disappears [ERROR=> ]";
93my $ERROR_APPEARS = "ERROR appears [ =>ERROR]";
94
Christophe Lyon71cec962016-06-28 18:27:30 +020095my $UNHANDLED_CASES = "Unhandled cases [ ..??.. ]";
96my $UNSTABLE_CASES = "Unstable cases, ignored [~RANDOM ]";
Christophe Lyonbff39612015-11-18 16:29:11 +010097
98my @handler_list = (
Christophe Lyondded4d82016-06-28 18:12:38 +020099 {was=>"PASS", is=>"PASS", cat=>$PASS_PASS},
100 {was=>"PASS", is=>"XPASS", cat=>$PASS_XPASS},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200101 {was=>"PASS", is=>"FAIL", handler=>\&handle_pass_fail},
102 {was=>"PASS", is=>"XFAIL", cat=>$PASS_XFAIL},
Christophe Lyon9dde3332016-06-28 23:00:00 +0200103 {was=>"PASS", is=>"UNSUPPORTED",cat=>$PASS_UNSUPPORTED},
104 {was=>"PASS", is=>"UNTESTED", cat=>$PASS_UNTESTED},
105 {was=>"PASS", is=>"UNRESOLVED",cat=>$PASS_UNRESOLVED},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200106 {was=>"PASS", is=>"NO_EXIST", cat=>$PASS_DISAPPEARS},
107 {was=>"NO_EXIST", is=>"PASS", cat=>$PASS_APPEARS},
108
Christophe Lyondded4d82016-06-28 18:12:38 +0200109 {was=>"XPASS", is=>"PASS", cat=>$XPASS_PASS},
110 {was=>"XPASS", is=>"XPASS", cat=>$XPASS_XPASS},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200111 {was=>"XPASS", is=>"FAIL", cat=>$XPASS_FAIL},
Christophe Lyondded4d82016-06-28 18:12:38 +0200112 {was=>"XPASS", is=>"XFAIL", cat=>$XPASS_XFAIL},
Christophe Lyon9dde3332016-06-28 23:00:00 +0200113 {was=>"XPASS", is=>"UNSUPPORTED",cat=>$XPASS_UNSUPPORTED},
114 {was=>"XPASS", is=>"UNTESTED", cat=>$XPASS_UNTESTED},
115 {was=>"XPASS", is=>"UNRESOLVED",cat=>$XPASS_UNRESOLVED},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200116 {was=>"XPASS", is=>"NO_EXIST", cat=>$XPASS_DISAPPEARS},
Christophe Lyona140aa82015-12-17 22:53:03 +0100117 {was=>"NO_EXIST", is=>"XPASS", cat=>$XPASS_APPEARS},
Christophe Lyonbff39612015-11-18 16:29:11 +0100118
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200119 {was=>"FAIL", is=>"PASS", cat=>$FAIL_PASS},
120 {was=>"FAIL", is=>"XPASS", cat=>$FAIL_XPASS},
121 {was=>"FAIL", is=>"FAIL", cat=>$FAIL_FAIL},
122 {was=>"FAIL", is=>"XFAIL", cat=>$FAIL_XFAIL},
Christophe Lyon9dde3332016-06-28 23:00:00 +0200123 {was=>"FAIL", is=>"UNSUPPORTED",cat=>$FAIL_UNSUPPORTED},
124 {was=>"FAIL", is=>"UNTESTED", cat=>$FAIL_UNTESTED},
125 {was=>"FAIL", is=>"UNRESOLVED",cat=>$FAIL_UNRESOLVED},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200126 {was=>"FAIL", is=>"NO_EXIST", cat=>$FAIL_DISAPPEARS},
Christophe Lyonbff39612015-11-18 16:29:11 +0100127 {was=>"NO_EXIST", is=>"FAIL", cat=>$FAIL_APPEARS},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200128
129 {was=>"XFAIL", is=>"PASS", cat=>$XFAIL_PASS},
130 {was=>"XFAIL", is=>"XPASS", cat=>$XFAIL_XPASS},
131 {was=>"XFAIL", is=>"FAIL", cat=>$XFAIL_FAIL},
132 {was=>"XFAIL", is=>"XFAIL", cat=>$XFAIL_XFAIL},
Christophe Lyon9dde3332016-06-28 23:00:00 +0200133 {was=>"XFAIL", is=>"UNSUPPORTED",cat=>$XFAIL_UNSUPPORTED},
134 {was=>"XFAIL", is=>"UNTESTED", cat=>$XFAIL_UNTESTED},
135 {was=>"XFAIL", is=>"UNRESOLVED",cat=>$XFAIL_UNRESOLVED},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200136 {was=>"XFAIL", is=>"NO_EXIST", cat=>$XFAIL_DISAPPEARS},
Christophe Lyonbff39612015-11-18 16:29:11 +0100137 {was=>"NO_EXIST", is=>"XFAIL", cat=>$XFAIL_APPEARS},
138
Christophe Lyon9dde3332016-06-28 23:00:00 +0200139 {was=>"UNSUPPORTED", is=>"PASS", cat=>$UNSUPPORTED_PASS},
Christophe Lyona140aa82015-12-17 22:53:03 +0100140 {was=>"UNSUPPORTED", is=>"XPASS", cat=>$UNSUPPORTED_XPASS},
Christophe Lyon9dde3332016-06-28 23:00:00 +0200141 {was=>"UNSUPPORTED", is=>"FAIL", cat=>$UNSUPPORTED_FAIL},
Christophe Lyona140aa82015-12-17 22:53:03 +0100142 {was=>"UNSUPPORTED", is=>"XFAIL", cat=>$UNSUPPORTED_XFAIL},
Christophe Lyon9dde3332016-06-28 23:00:00 +0200143 {was=>"UNSUPPORTED", is=>"UNSUPPORTED",cat=>$UNSUPPORTED_UNSUPPORTED},
144 {was=>"UNSUPPORTED", is=>"UNTESTED", cat=>$UNSUPPORTED_UNTESTED},
145 {was=>"UNSUPPORTED", is=>"UNRESOLVED",cat=>$UNSUPPORTED_UNRESOLVED},
Christophe Lyona140aa82015-12-17 22:53:03 +0100146 {was=>"UNSUPPORTED", is=>"NO_EXIST", cat=>$UNSUPPORTED_DISAPPEARS},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200147 {was=>"NO_EXIST", is=>"UNSUPPORTED", cat=>$UNSUPPORTED_APPEARS},
Christophe Lyona140aa82015-12-17 22:53:03 +0100148
149 {was=>"UNTESTED", is=>"PASS", cat=>$UNTESTED_PASS},
150 {was=>"UNTESTED", is=>"XPASS", cat=>$UNTESTED_XPASS},
151 {was=>"UNTESTED", is=>"FAIL", cat=>$UNTESTED_FAIL},
152 {was=>"UNTESTED", is=>"XFAIL", cat=>$UNTESTED_XFAIL},
Christophe Lyon9dde3332016-06-28 23:00:00 +0200153 {was=>"UNTESTED", is=>"UNSUPPORTED",cat=>$UNTESTED_UNSUPPORTED},
154 {was=>"UNTESTED", is=>"UNTESTED", cat=>$UNTESTED_UNTESTED},
155 {was=>"UNTESTED", is=>"UNRESOLVED",cat=>$UNTESTED_UNRESOLVED},
Christophe Lyona140aa82015-12-17 22:53:03 +0100156 {was=>"UNTESTED", is=>"NO_EXIST", cat=>$UNTESTED_DISAPPEARS},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200157 {was=>"NO_EXIST", is=>"UNTESTED", cat=>$UNTESTED_APPEARS},
Christophe Lyona140aa82015-12-17 22:53:03 +0100158
159 {was=>"UNRESOLVED", is=>"PASS", cat=>$UNRESOLVED_PASS},
160 {was=>"UNRESOLVED", is=>"XPASS", cat=>$UNRESOLVED_XPASS},
161 {was=>"UNRESOLVED", is=>"FAIL", cat=>$UNRESOLVED_FAIL},
162 {was=>"UNRESOLVED", is=>"XFAIL", cat=>$UNRESOLVED_XFAIL},
Christophe Lyon9dde3332016-06-28 23:00:00 +0200163 {was=>"UNRESOLVED", is=>"UNSUPPORTED",cat=>$UNRESOLVED_UNSUPPORTED},
164 {was=>"UNRESOLVED", is=>"UNTESTED", cat=>$UNRESOLVED_UNTESTED},
165 {was=>"UNRESOLVED", is=>"UNRESOLVED",cat=>$UNRESOLVED_UNRESOLVED},
Christophe Lyona140aa82015-12-17 22:53:03 +0100166 {was=>"UNRESOLVED", is=>"NO_EXIST", cat=>$UNRESOLVED_DISAPPEARS},
Christophe Lyondc66fc52016-04-05 17:38:07 +0200167 {was=>"NO_EXIST", is=>"UNRESOLVED", cat=>$UNRESOLVED_APPEARS},
Christophe Lyondc66fc52016-04-05 17:38:07 +0200168
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200169 {was=>"ERROR", is=>"NO_EXIST", cat=>$ERROR_DISAPPEARS},
170 {was=>"NO_EXIST", is=>"ERROR", cat=>$ERROR_APPEARS},
171
Christophe Lyonbff39612015-11-18 16:29:11 +0100172# {was=>"NO_EXIST", is=>"NO_EXIST", handler=>\&handle_not_yet_supported}
173);
174
175######################################################
176# TREAT ARGUMENTS
177
178my $verbose=0;
179my $quiet=0;
180my $long=0;
181my $short=0;
182my $debug=0;
183my ($testroot, $basename);
184my ($ref_file_name, $res_file_name);
185my $nounstable=0;
186my $unstablefile=0;
187my @unstable_markers=();
Christophe Lyonca9d8302017-05-22 12:04:00 +0000188my $ratio_thresh = 0.95; # Warn if pass ratio is below this threshold
Christophe Lyonbff39612015-11-18 16:29:11 +0100189
190GetOptions ("l" => \$long,
191 "s" => \$short,
192 "q" => \$quiet,
193 "v" => \$verbose,
194 "dbg" => \$debug,
195 "testroot=s" => \$testroot,
196 "basename=s" => \$basename,
Christophe Lyonca9d8302017-05-22 12:04:00 +0000197 "pass-thresh=f" => \$ratio_thresh,
Christophe Lyonbff39612015-11-18 16:29:11 +0100198 "no-unstable" => \$nounstable,
199 "unstable-tests=s" => \$unstablefile,
200 "unstable-marker=s" => \@unstable_markers);
201
202$ref_file_name = $ARGV[0] if ($#ARGV == 1);
203$res_file_name = $ARGV[1] if ($#ARGV == 1);
204
205$ref_file_name = $testroot."/expected_results/".$basename if ($testroot and $basename);
206$res_file_name = $testroot."/testing/run/".$basename if ($testroot and $basename);
207&usage if (not $ref_file_name or not $res_file_name);
208
209my ($col_boldred, $col_red, $col_boldgreen, $col_green, $col_boldpink, $col_pink, $col_reset)
210 = ("\033[31;1m","\033[31;3m","\033[32;1m","\033[32;3m","\033[35;1m","\033[35;2m","\033[0m");
211($col_boldred, $col_red, $col_boldgreen, $col_green, $col_boldpink, $col_pink, $col_reset)
212 = ("","","","","","","") if (not I_am_interactive());
213
214######################################################
215# MAIN PROGRAM
216# print "comparing $ref_file_name $res_file_name\n";
217
218# If none of the 2 .sum exists, nothing to compare: exit early.
219exit 0 if ( (! -e $ref_file_name) && (! -e $res_file_name ));
220
221my $ref = read_sum($ref_file_name) ;
222my $res = read_sum($res_file_name) ;
223my @unstablelist = ();
224
225@unstablelist = read_unstable($unstablefile) if ($unstablefile ne 0);
226
227compare_results($ref, $res);
228
229my $final_result = print_compare_results_summary($ref, $res);
230
231exit $final_result;
232
233######################################################
234# UTILITIES
235
236sub empty_result()
237{
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200238 my %empty_result;# = {PASS=>0, FAIL=>0, XPASS=>0, XFAIL=>0, UNSUPPORTED=>0, UNTESTED=>0, UNRESOLVED=>0, ERROR=>0};
Christophe Lyonbff39612015-11-18 16:29:11 +0100239 $empty_result{PASS}=$empty_result{FAIL}=$empty_result{XPASS}=$empty_result{XFAIL}=0;
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200240 $empty_result{UNSUPPORTED}=$empty_result{UNTESTED}=$empty_result{UNRESOLVED}=$empty_result{NO_EXIST}=$empty_result{ERROR}=0;
Christophe Lyonbff39612015-11-18 16:29:11 +0100241 return \%empty_result;
242}
243sub I_am_interactive {
244 return -t STDIN && -t STDOUT;
245}
246sub usage()
247{
248 print "Usage : $app <ref_file.sum> <result_file.sum>\n";
249 exit 1;
250}
251
252
253######################################################
254# PARSING
255sub read_sum($)
256{
257 my ($sum_file) = @_;
258 my $res = empty_result();
259 my %testcases;
260 my %unsupported;
261 $res->{testcases} = \%testcases;
262 my $pending_timeout=0;
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000263 my $current_exp="";
Christophe Lyonbff39612015-11-18 16:29:11 +0100264
Christophe Lyonad8c7242016-02-03 13:04:28 +0100265 $res->{EXEC}->{PASS} = 0;
266 $res->{EXEC}->{FAIL} = 0;
267
Christophe Lyonbff39612015-11-18 16:29:11 +0100268 open SUMFILE, $sum_file or die $!;
269 while (<SUMFILE>)
270 {
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000271 if (m/^(PASS|XPASS|FAIL|XFAIL|UNSUPPORTED|UNTESTED|UNRESOLVED|ERROR): *(.*)/)
Christophe Lyonbff39612015-11-18 16:29:11 +0100272 {
273 my ($diag,$tc) = ($1,$2);
274 my %tcresult;
275 $tc =~ s/==[0-9]+== Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly./==<pid>== Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly./;
276 $testcases{$tc} = empty_result() if (not exists $testcases{$tc});
277 $testcases{$tc}->{$diag}++;
278 $testcases{$tc}->{HAS_TIMED_OUT} = $pending_timeout;
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000279 $testcases{$tc}->{EXP} = $current_exp;
Christophe Lyonbff39612015-11-18 16:29:11 +0100280 $pending_timeout = 0;
281 $res->{$diag}++;
Christophe Lyonad8c7242016-02-03 13:04:28 +0100282 # Count execution tests, for a sanity check
283 if ($tc =~ /execution/)
284 {
285 $res->{EXEC}->{$diag}++;
286 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100287 }
288 elsif (m/WARNING: program timed out/)
289 {
290 $pending_timeout = 1;
291 }
292 elsif (m/^(# of expected passes|# of unexpected failures|# of expected failures|# of known failures|# of unsupported tests|# of untested testcases)\s+(.*)/)
293 {
294 $res->{"summary - "."$1"} = $2;
295 }
296 elsif (m/^\/.*\/([^\/]+)\s+version\s+(.*)/)
297 {
298 $res->{tool} = $1;
299 $res->{version} = $2;
300 $res->{version} =~ s/ [-(].*//;
301 }
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000302 elsif (m/^Running target .*/)
303 {
304 }
305 elsif (m/^Running (.*) \.\.\.*/)
306 {
307 $current_exp=$1;
308 $current_exp =~ s|.*/testsuite/||;
309 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100310 }
311 close SUMFILE;
312 return $res;
313}
314
315# Parse list on unstable tests
316sub read_unstable($)
317{
318 my ($unstable_file) = @_;
319 my @unstable_tests = ();
320
321 open UNSTABLEFILE, $unstable_file or die $!;
322 while (<UNSTABLEFILE>)
323 {
324 # Skip lines starting with '#', or with spaces only
325 if ((/^#/) || (/^[ ]*$/))
326 {
327 }
328 else
329 {
330 chomp;
331
332 my $test = $_;
333
334 # Check if line is of type: target:testname
Christophe Lyon5e7241c2015-12-04 12:57:27 +0100335 if (/^(.*?):/)
Christophe Lyonbff39612015-11-18 16:29:11 +0100336 {
337 foreach my $unstable_marker (@unstable_markers)
338 {
339 if ($unstable_marker eq $1) {
340 # If target matches the one supplied as script
341 # argument, add the testname to the list
Christophe Lyon5e7241c2015-12-04 12:57:27 +0100342 $test =~ s/.*?://;
Christophe Lyonbff39612015-11-18 16:29:11 +0100343 push @unstable_tests, $test;
344 }
345 }
346 } else {
347 push @unstable_tests, $test;
348 }
349 }
350 }
351 close UNSTABLEFILE;
352 return @unstable_tests;
353}
354
355######################################################
356# DIFFING
357sub handle_pass_fail($$$$)
358{
359 my ($ref, $res, $diag_diag, $tc) = @_;
360 if ($res->{testcases}->{$tc}->{HAS_TIMED_OUT})
361 {
362 push @{$res->{$PASSED_NOW_TIMEOUTS}}, $tc;
363 }
364 else
365 {
Christophe Lyondded4d82016-06-28 18:12:38 +0200366 push @{$res->{$PASS_FAIL}}, $tc;
Christophe Lyonbff39612015-11-18 16:29:11 +0100367 }
368}
369
370sub compare_results($$)
371{
372 my ($ref, $res) = @_;
373
Christophe Lyondded4d82016-06-28 18:12:38 +0200374 @{$res->{$PASS_PASS}} = ();
Christophe Lyondded4d82016-06-28 18:12:38 +0200375 @{$res->{$PASS_XPASS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200376 @{$res->{$PASS_FAIL}} = ();
377 @{$res->{$PASS_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200378 @{$res->{$PASS_UNSUPPORTED}} = ();
379 @{$res->{$PASS_UNTESTED}} = ();
380 @{$res->{$PASS_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200381 @{$res->{$PASS_DISAPPEARS}} = ();
382 @{$res->{$PASS_APPEARS}} = ();
383 @{$res->{$PASSED_NOW_TIMEOUTS}} = ();
384
Christophe Lyondded4d82016-06-28 18:12:38 +0200385 @{$res->{$XPASS_PASS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200386 @{$res->{$XPASS_XPASS}} = ();
387 @{$res->{$XPASS_FAIL}} = ();
388 @{$res->{$XPASS_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200389 @{$res->{$XPASS_UNSUPPORTED}} = ();
390 @{$res->{$XPASS_UNTESTED}} = ();
391 @{$res->{$XPASS_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200392 @{$res->{$XPASS_DISAPPEARS}} = ();
393 @{$res->{$XPASS_APPEARS}} = ();
394
395 @{$res->{$FAIL_PASS}} = ();
396 @{$res->{$FAIL_XPASS}} = ();
397 @{$res->{$FAIL_FAIL}} = ();
398 @{$res->{$FAIL_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200399 @{$res->{$FAIL_UNSUPPORTED}} = ();
400 @{$res->{$FAIL_UNTESTED}} = ();
401 @{$res->{$FAIL_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200402 @{$res->{$FAIL_DISAPPEARS}} = ();
403 @{$res->{$FAIL_APPEARS}} = ();
404
Christophe Lyondded4d82016-06-28 18:12:38 +0200405 @{$res->{$XFAIL_PASS}} = ();
406 @{$res->{$XFAIL_XPASS}} = ();
407 @{$res->{$XFAIL_FAIL}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200408 @{$res->{$XFAIL_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200409 @{$res->{$XFAIL_UNSUPPORTED}} = ();
410 @{$res->{$XFAIL_UNTESTED}} = ();
411 @{$res->{$XFAIL_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200412 @{$res->{$XFAIL_DISAPPEARS}} = ();
413 @{$res->{$XFAIL_APPEARS}} = ();
414
Christophe Lyona140aa82015-12-17 22:53:03 +0100415 @{$res->{$UNSUPPORTED_PASS}} = ();
416 @{$res->{$UNSUPPORTED_XPASS}} = ();
417 @{$res->{$UNSUPPORTED_FAIL}} = ();
418 @{$res->{$UNSUPPORTED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200419 @{$res->{$UNSUPPORTED_UNSUPPORTED}} = ();
420 @{$res->{$UNSUPPORTED_UNTESTED}} = ();
421 @{$res->{$UNSUPPORTED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100422 @{$res->{$UNSUPPORTED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200423 @{$res->{$UNSUPPORTED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200424
Christophe Lyona140aa82015-12-17 22:53:03 +0100425 @{$res->{$UNTESTED_PASS}} = ();
426 @{$res->{$UNTESTED_XPASS}} = ();
427 @{$res->{$UNTESTED_FAIL}} = ();
428 @{$res->{$UNTESTED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200429 @{$res->{$UNTESTED_UNSUPPORTED}} = ();
430 @{$res->{$UNTESTED_UNTESTED}} = ();
431 @{$res->{$UNTESTED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100432 @{$res->{$UNTESTED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200433 @{$res->{$UNTESTED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200434
Christophe Lyona140aa82015-12-17 22:53:03 +0100435 @{$res->{$UNRESOLVED_PASS}} = ();
436 @{$res->{$UNRESOLVED_XPASS}} = ();
437 @{$res->{$UNRESOLVED_FAIL}} = ();
438 @{$res->{$UNRESOLVED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200439 @{$res->{$UNRESOLVED_UNSUPPORTED}} = ();
440 @{$res->{$UNRESOLVED_UNTESTED}} = ();
441 @{$res->{$UNRESOLVED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100442 @{$res->{$UNRESOLVED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200443 @{$res->{$UNRESOLVED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200444
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200445 @{$res->{$ERROR_DISAPPEARS}} = ();
446 @{$res->{$ERROR_APPEARS}} = ();
447
Christophe Lyonbff39612015-11-18 16:29:11 +0100448 @{$res->{$UNHANDLED_CASES}} = ();
449 @{$res->{$UNSTABLE_CASES}} = ();
450
451 #### MERGE REF AND RES
452 foreach my $key (sort (keys %{$res->{testcases}}))
453 {
454 if (not exists $ref->{testcases}->{$key}) {
455 $ref->{testcases}->{$key} = empty_result();
456 $ref->{testcases}->{$key}->{NO_EXIST} = 1;
457 }
458 }
459 foreach my $key (keys %{$ref->{testcases}})
460 {
461 if (not exists $res->{testcases}->{$key})
462 {
463 $res->{testcases}->{$key} = empty_result();
464 $res->{testcases}->{$key}->{NO_EXIST} = 1;
465 }
466 }
467
468 #### ACTIONS FOR EACH CASES
469 my %unstable_found;
470
471 foreach my $key (sort (keys %{$ref->{testcases}}))
472 {
473 foreach my $diag_diag (@handler_list)
474 {
475 if ($ref->{testcases}->{$key}->{$diag_diag->{was}} != $res->{testcases}->{$key}->{$diag_diag->{was}}
476 and $res->{testcases}->{$key}->{$diag_diag->{is}})
477 {
Christophe Lyondc66fc52016-04-05 17:38:07 +0200478 print "$key ref was:$ref->{testcases}->{$key}->{$diag_diag->{was}}, res was:$res->{testcases}->{$key}->{$diag_diag->{was}}, res is:$res->{testcases}->{$key}->{$diag_diag->{is}} \n" if ($debug);
Christophe Lyonbff39612015-11-18 16:29:11 +0100479 # If testcase is listed as 'unstable' mark it as
480 # such and skip other processing.
481 {
482 if (grep { (index $key,$_)!=-1} @unstablelist)
483 {
484 print "[unstable] $key\n" if ($debug);
485 $unstable_found{$key}=1;
486 }
487 else {
488 print "[$diag_diag->{was} => $diag_diag->{is}] $key\n" if ($debug);
489 if ($diag_diag->{handler})
490 {
491 $diag_diag->{handler} ($ref, $res, $diag_diag, $key);
492 }
493 else
494 {
495 push @{$res->{$diag_diag->{cat}}}, $key;
496 }
497 }
498 }
499 }
500 }
501 }
502 push @{$res->{$UNSTABLE_CASES}}, (sort (keys (%unstable_found))) if ($nounstable == 0);
503
504}
505
506######################################################
507# PRINTING
508sub print_tclist($@)
509{
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000510 # The 1st parameter is used to find the name of the .exp file
511 # associated with the testcase. In the case where the testcase
512 # disappeared in the current results compared to the reference,
513 # make sure to pass the reference results as 1st parameter,
514 # otherwise there will be an undefined reference.
515 my ($this_res, $cat, @tclist) = @_;
516 my $this_exp = "";
517 if (scalar(@tclist))
518 {
519 print " - ".$cat.":\n\n";
520 foreach my $case (@tclist)
521 {
522 if ($this_exp ne $this_res->{testcases}->{$case}->{EXP}) {
523 $this_exp = $this_res->{testcases}->{$case}->{EXP};
524 print " Executed from: $this_exp\n";
525 }
526 print " $case\n";
527 }
528 print "\n\n";
529 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100530}
531
532sub print_compare_results_summary($$)
533{
534 my ($ref, $res) = @_;
535 my $return_value=0;
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100536 my $total_better = 0;
Christophe Lyonbff39612015-11-18 16:29:11 +0100537 my $rtotal = 0;
538 my $quiet_reg = $quiet;
Christophe Lyond618f662016-02-02 19:07:58 +0100539 my $ref_ratio = 0;
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200540 my $ref_total = 0;
Christophe Lyond618f662016-02-02 19:07:58 +0100541 my $res_ratio = 0;
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200542 my $res_total = 0;
Christophe Lyonad8c7242016-02-03 13:04:28 +0100543 my $ignore_exec = 0;
544 my $ref_has_exec_tests = 0;
545 my $res_has_exec_tests = 0;
Christophe Lyond618f662016-02-02 19:07:58 +0100546
547 # Compute the pass ratio as a sanity check
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200548 $ref_total = $ref->{PASS} +
549 $ref->{XFAIL} +
550 $ref->{XPASS} +
551 $ref->{FAIL} +
552 $ref->{UNRESOLVED} +
553 $ref->{UNSUPPORTED} +
554 $ref->{UNTESTED};
555
556 # It is possible that no test is executed at all (for instance if
557 # RUNTESTFLAGS was too restrictive). Avoid division by 0.
558 if ($ref_total > 0) {
559 $ref_ratio = ($ref->{PASS} + $ref->{XFAIL}) /
560 $ref_total;
561 }
562
563 $res_total = $res->{PASS} +
564 $res->{XFAIL} +
565 $res->{XPASS} +
566 $res->{FAIL} +
567 $res->{UNRESOLVED} +
568 $res->{UNSUPPORTED} +
569 $res->{UNTESTED};
570
571 if ($res_total > 0) {
572 $res_ratio = ($res->{PASS} + $res->{XFAIL}) /
573 $res_total;
574 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100575
576 if (not $quiet)
577 {
578 printf "Comparing:\n";
579 printf "REFERENCE:$ref_file_name\n";
580 printf "CURRENT: $res_file_name\n\n";
581 }
582
583 #### TESTS STATUS
584 if (not $quiet and not $short)
585 {
586 printf " ` +---------+---------+\n";
Christophe Lyona140aa82015-12-17 22:53:03 +0100587 printf "o RUN STATUS: | REF | RES |\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100588 printf " +------------------------------------------+---------+---------+\n";
Christophe Lyona140aa82015-12-17 22:53:03 +0100589 printf " | %-40s | %7d | %7d |\n", "Passes [PASS]", $ref->{PASS}, $res->{PASS};
Christophe Lyonbff39612015-11-18 16:29:11 +0100590 printf " | %-40s | %7d | %7d |\n", "Unexpected fails [FAIL]", $ref->{FAIL}, $res->{FAIL};
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200591 printf " | %-40s | %7d | %7d |\n", "Errors [ERROR]", $ref->{ERROR}, $res->{ERROR};
Christophe Lyona140aa82015-12-17 22:53:03 +0100592 printf " | %-40s | %7d | %7d |\n", "Unexpected passes [XPASS]", $ref->{XPASS}, $res->{XPASS};
Christophe Lyonbff39612015-11-18 16:29:11 +0100593 printf " | %-40s | %7d | %7d |\n", "Expected fails [XFAIL]", $ref->{XFAIL}, $res->{XFAIL};
594 printf " | %-40s | %7d | %7d |\n", "Unresolved [UNRESOLVED]", $ref->{UNRESOLVED}, $res->{UNRESOLVED};
Christophe Lyona140aa82015-12-17 22:53:03 +0100595 printf " | %-40s | %7d | %7d |\n", "Unsupported [UNSUPPORTED]", $ref->{UNSUPPORTED}, $res->{UNSUPPORTED};
596 printf " | %-40s | %7d | %7d |\n", "Untested [UNTESTED]", $ref->{UNTESTED}, $res->{UNTESTED};
Christophe Lyonbff39612015-11-18 16:29:11 +0100597 printf " +------------------------------------------+---------+---------+\n";
598 printf "\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100599
Christophe Lyon3d195c22016-04-06 16:00:25 +0200600 printf " REF PASS ratio: %f\n", $ref_ratio;
601 printf " RES PASS ratio: %f\n", $res_ratio;
Christophe Lyond618f662016-02-02 19:07:58 +0100602 if ($ref_ratio < $ratio_thresh)
603 {
Christophe Lyon1176f962016-03-03 18:01:10 +0100604 printf " ***** ERROR: REF PASS ratio is abnormally low *****\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100605 }
606 if ($res_ratio < $ratio_thresh)
607 {
Christophe Lyon1176f962016-03-03 18:01:10 +0100608 printf " ***** ERROR: RES PASS ratio is abnormally low *****\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100609 }
610
Christophe Lyonad8c7242016-02-03 13:04:28 +0100611 # If both PASS and FAIL EXEC tests are zero, assume there is no
612 # execution test for this tool, and do not warn.
613 $ref_has_exec_tests = ($ref->{EXEC}->{PASS} + $ref->{EXEC}->{FAIL}) != 0;
614 if ($ref_has_exec_tests)
615 {
616 printf " ***** ERROR: No REF execution test PASSed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{PASS} == 0);
617 printf " ***** WARNING: No REF execution test FAILed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{FAIL} == 0);
618 }
619
620 $res_has_exec_tests = ($res->{EXEC}->{PASS} + $res->{EXEC}->{FAIL}) != 0;
621 if ($res_has_exec_tests)
622 {
623 printf " ***** ERROR: No RES execution test PASSed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{PASS} == 0);
624 printf " ***** WARNING: No RES execution test FAILed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{FAIL} == 0);
625 }
626
627 # Ignore number of execution tests when computing the return
628 # value, if both REF and RES have no execution test.
629 $ignore_exec = !$ref_has_exec_tests && !$res_has_exec_tests;
Christophe Lyonbff39612015-11-18 16:29:11 +0100630 }
631
632 #### REGRESSIONS ?
Christophe Lyon9dde3332016-06-28 23:00:00 +0200633 $rtotal = scalar(@{$res->{$PASS_XPASS}})
634 +scalar(@{$res->{$PASS_FAIL}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200635 +scalar(@{$res->{$PASS_UNRESOLVED}})
636 +scalar(@{$res->{$PASSED_NOW_TIMEOUTS}})
637 +scalar(@{$res->{$XPASS_FAIL}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100638 +scalar(@{$res->{$XPASS_APPEARS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200639 +scalar(@{$res->{$XPASS_UNRESOLVED}})
640 +scalar(@{$res->{$FAIL_APPEARS}})
641 +scalar(@{$res->{$FAIL_UNRESOLVED}})
Christophe Lyondded4d82016-06-28 18:12:38 +0200642 +scalar(@{$res->{$XFAIL_FAIL}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100643 +scalar(@{$res->{$XFAIL_DISAPPEARS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200644 +scalar(@{$res->{$XFAIL_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100645 +scalar(@{$res->{$UNSUPPORTED_FAIL}})
646 +scalar(@{$res->{$UNSUPPORTED_XPASS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200647 +scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100648 +scalar(@{$res->{$UNTESTED_FAIL}})
649 +scalar(@{$res->{$UNTESTED_XPASS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200650 +scalar(@{$res->{$UNTESTED_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100651 +scalar(@{$res->{$UNRESOLVED_FAIL}})
652 +scalar(@{$res->{$UNRESOLVED_XPASS}})
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200653 +scalar(@{$res->{$UNRESOLVED_APPEARS}})
654 +scalar(@{$res->{$ERROR_APPEARS}});
Christophe Lyona140aa82015-12-17 22:53:03 +0100655
656 $quiet_reg=1 if ($short and not $rtotal);
Christophe Lyonbff39612015-11-18 16:29:11 +0100657
658 if (not $quiet_reg)
659 {
Christophe Lyona140aa82015-12-17 22:53:03 +0100660 printf "\n$col_red"."o REGRESSIONS:\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100661 printf " +------------------------------------------+---------+\n";
Christophe Lyondded4d82016-06-28 18:12:38 +0200662 printf " | %-40s | %7d |\n", $PASS_XPASS, scalar(@{$res->{$PASS_XPASS}}) if (scalar(@{$res->{$PASS_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200663 printf " | %-40s | %7d |\n", $PASS_FAIL, scalar(@{$res->{$PASS_FAIL}}) if (scalar(@{$res->{$PASS_FAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200664 printf " | %-40s | %7d |\n", $PASS_UNRESOLVED, scalar(@{$res->{$PASS_UNRESOLVED}}) if (scalar(@{$res->{$PASS_UNRESOLVED}}));
665 printf " | %-40s | %7d |\n", $PASSED_NOW_TIMEOUTS, scalar(@{$res->{$PASSED_NOW_TIMEOUTS}}) if (scalar(@{$res->{$PASSED_NOW_TIMEOUTS}}));
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200666 printf " | %-40s | %7d |\n", $ERROR_APPEARS, scalar(@{$res->{$ERROR_APPEARS}}) if (scalar(@{$res->{$ERROR_APPEARS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200667 printf " | %-40s | %7d |\n", $XPASS_FAIL, scalar(@{$res->{$XPASS_FAIL}}) if (scalar(@{$res->{$XPASS_FAIL}}));
668 printf " | %-40s | %7d |\n", $XPASS_APPEARS, scalar(@{$res->{$XPASS_APPEARS}}) if (scalar(@{$res->{$XPASS_APPEARS}}));
669 printf " | %-40s | %7d |\n", $XPASS_UNRESOLVED, scalar(@{$res->{$XPASS_UNRESOLVED}}) if (scalar(@{$res->{$XPASS_UNRESOLVED}}));
670 printf " | %-40s | %7d |\n", $FAIL_APPEARS, scalar(@{$res->{$FAIL_APPEARS}}) if (scalar(@{$res->{$FAIL_APPEARS}}));
671 printf " | %-40s | %7d |\n", $FAIL_UNRESOLVED, scalar(@{$res->{$FAIL_UNRESOLVED}}) if (scalar(@{$res->{$FAIL_UNRESOLVED}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200672 printf " | %-40s | %7d |\n", $XFAIL_FAIL, scalar(@{$res->{$XFAIL_FAIL}}) if (scalar(@{$res->{$XFAIL_FAIL}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100673 printf " | %-40s | %7d |\n", $XFAIL_DISAPPEARS, scalar(@{$res->{$XFAIL_DISAPPEARS}}) if (scalar(@{$res->{$XFAIL_DISAPPEARS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200674 printf " | %-40s | %7d |\n", $XFAIL_UNRESOLVED, scalar(@{$res->{$XFAIL_UNRESOLVED}}) if (scalar(@{$res->{$XFAIL_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100675 printf " | %-40s | %7d |\n", $UNSUPPORTED_FAIL, scalar(@{$res->{$UNSUPPORTED_FAIL}}) if (scalar(@{$res->{$UNSUPPORTED_FAIL}}));
676 printf " | %-40s | %7d |\n", $UNSUPPORTED_XPASS, scalar(@{$res->{$UNSUPPORTED_XPASS}}) if (scalar(@{$res->{$UNSUPPORTED_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200677 printf " | %-40s | %7d |\n", $UNSUPPORTED_UNRESOLVED, scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}) if (scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100678 printf " | %-40s | %7d |\n", $UNTESTED_FAIL, scalar(@{$res->{$UNTESTED_FAIL}}) if (scalar(@{$res->{$UNTESTED_FAIL}}));
679 printf " | %-40s | %7d |\n", $UNTESTED_XPASS, scalar(@{$res->{$UNTESTED_XPASS}}) if (scalar(@{$res->{$UNTESTED_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200680 printf " | %-40s | %7d |\n", $UNTESTED_UNRESOLVED, scalar(@{$res->{$UNTESTED_UNRESOLVED}}) if (scalar(@{$res->{$UNTESTED_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100681 printf " | %-40s | %7d |\n", $UNRESOLVED_FAIL, scalar(@{$res->{$UNRESOLVED_FAIL}}) if (scalar(@{$res->{$UNRESOLVED_FAIL}}));
682 printf " | %-40s | %7d |\n", $UNRESOLVED_XPASS, scalar(@{$res->{$UNRESOLVED_XPASS}}) if (scalar(@{$res->{$UNRESOLVED_XPASS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200683 printf " | %-40s | %7d |\n", $UNRESOLVED_APPEARS, scalar(@{$res->{$UNRESOLVED_APPEARS}}) if (scalar(@{$res->{$UNRESOLVED_APPEARS}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100684 printf " +------------------------------------------+---------+\n";
685 printf " | %-40s | %7d |\n", "TOTAL_REGRESSIONS", $rtotal;
686 printf " +------------------------------------------+---------+\n";
687 printf "\n";
688
689 if ($long)
690 {
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000691 print_tclist($res, $PASS_XPASS, @{$res->{$PASS_XPASS}});
692 print_tclist($res, $PASS_FAIL, @{$res->{$PASS_FAIL}});
693 print_tclist($res, $PASS_UNRESOLVED, @{$res->{$PASS_UNRESOLVED}});
694 print_tclist($res, $PASSED_NOW_TIMEOUTS, @{$res->{$PASSED_NOW_TIMEOUTS}});
695 print_tclist($res, $ERROR_APPEARS, @{$res->{$ERROR_APPEARS}});
696 print_tclist($res, $XPASS_FAIL, @{$res->{$XPASS_FAIL}});
697 print_tclist($res, $XPASS_APPEARS, @{$res->{$XPASS_APPEARS}});
698 print_tclist($res, $XPASS_UNRESOLVED, @{$res->{$XPASS_UNRESOLVED}});
699 print_tclist($res, $FAIL_APPEARS, @{$res->{$FAIL_APPEARS}});
700 print_tclist($res, $FAIL_UNRESOLVED, @{$res->{$FAIL_UNRESOLVED}});
701 print_tclist($res, $XFAIL_FAIL, @{$res->{$XFAIL_FAIL}});
702 # When testcases disappear, make sure to pass $ref as 1st argument
703 print_tclist($ref, $XFAIL_DISAPPEARS, @{$res->{$XFAIL_DISAPPEARS}});
704 print_tclist($res, $XFAIL_UNRESOLVED, @{$res->{$XFAIL_UNRESOLVED}});
705 print_tclist($res, $UNSUPPORTED_FAIL, @{$res->{$UNSUPPORTED_FAIL}});
706 print_tclist($res, $UNSUPPORTED_XPASS, @{$res->{$UNSUPPORTED_XPASS}});
707 print_tclist($res, $UNSUPPORTED_UNRESOLVED, @{$res->{$UNSUPPORTED_UNRESOLVED}});
708 print_tclist($res, $UNTESTED_FAIL, @{$res->{$UNTESTED_FAIL}});
709 print_tclist($res, $UNTESTED_XPASS, @{$res->{$UNTESTED_XPASS}});
710 print_tclist($res, $UNTESTED_UNRESOLVED, @{$res->{$UNTESTED_UNRESOLVED}});
711 print_tclist($res, $UNRESOLVED_FAIL, @{$res->{$UNRESOLVED_FAIL}});
712 print_tclist($res, $UNRESOLVED_XPASS, @{$res->{$UNRESOLVED_XPASS}});
713 print_tclist($res, $UNRESOLVED_APPEARS, @{$res->{$UNRESOLVED_APPEARS}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100714 }
715 printf "$col_reset\n";
716 }
717
718 #### MINOR TO BE CHECKED ?
719 if (not $quiet and not $short)
720 {
Christophe Lyon9dde3332016-06-28 23:00:00 +0200721 $total_better =
Christophe Lyon31279df2016-07-04 17:02:12 +0200722 scalar(@{$res->{$PASS_DISAPPEARS}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200723 scalar(@{$res->{$PASS_XFAIL}})+
724 scalar(@{$res->{$PASS_APPEARS}})+
725 scalar(@{$res->{$PASS_UNSUPPORTED}})+
726 scalar(@{$res->{$PASS_UNTESTED}})+
727 scalar(@{$res->{$XPASS_PASS}})+
728 scalar(@{$res->{$XPASS_XFAIL}})+
729 scalar(@{$res->{$XPASS_UNSUPPORTED}})+
730 scalar(@{$res->{$XPASS_UNTESTED}})+
731 scalar(@{$res->{$XPASS_DISAPPEARS}})+
Christophe Lyondded4d82016-06-28 18:12:38 +0200732 scalar(@{$res->{$FAIL_PASS}})+
733 scalar(@{$res->{$FAIL_XPASS}})+
Christophe Lyondded4d82016-06-28 18:12:38 +0200734 scalar(@{$res->{$FAIL_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200735 scalar(@{$res->{$FAIL_UNSUPPORTED}})+
736 scalar(@{$res->{$FAIL_UNTESTED}})+
737 scalar(@{$res->{$FAIL_DISAPPEARS}})+
738 scalar(@{$res->{$XFAIL_PASS}})+
739 scalar(@{$res->{$XFAIL_XPASS}})+
740 scalar(@{$res->{$XFAIL_UNSUPPORTED}})+
741 scalar(@{$res->{$XFAIL_UNTESTED}})+
742 scalar(@{$res->{$XFAIL_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100743 scalar(@{$res->{$UNSUPPORTED_PASS}})+
744 scalar(@{$res->{$UNSUPPORTED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200745 scalar(@{$res->{$UNSUPPORTED_UNTESTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100746 scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}})+
Christophe Lyondc66fc52016-04-05 17:38:07 +0200747 scalar(@{$res->{$UNSUPPORTED_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100748 scalar(@{$res->{$UNTESTED_PASS}})+
749 scalar(@{$res->{$UNTESTED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200750 scalar(@{$res->{$UNTESTED_UNSUPPORTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100751 scalar(@{$res->{$UNTESTED_DISAPPEARS}})+
Christophe Lyondc66fc52016-04-05 17:38:07 +0200752 scalar(@{$res->{$UNTESTED_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100753 scalar(@{$res->{$UNRESOLVED_PASS}})+
754 scalar(@{$res->{$UNRESOLVED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200755 scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}})+
756 scalar(@{$res->{$UNRESOLVED_UNTESTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100757 scalar(@{$res->{$UNRESOLVED_DISAPPEARS}})+
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200758 scalar(@{$res->{$ERROR_DISAPPEARS}})+
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100759 scalar(@{$res->{$UNHANDLED_CASES}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100760
Christophe Lyona140aa82015-12-17 22:53:03 +0100761 printf "$col_pink"."o MINOR TO BE CHECKED:\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100762 printf " +------------------------------------------+---------+\n";
Christophe Lyon31279df2016-07-04 17:02:12 +0200763 printf " | %-40s | %7d |\n", $PASS_DISAPPEARS, scalar(@{$res->{$PASS_DISAPPEARS}}) if (scalar(@{$res->{$PASS_DISAPPEARS}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200764 printf " | %-40s | %7d |\n", $PASS_XFAIL, scalar(@{$res->{$PASS_XFAIL}}) if (scalar(@{$res->{$PASS_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200765 printf " | %-40s | %7d |\n", $PASS_APPEARS, scalar(@{$res->{$PASS_APPEARS}}) if (scalar(@{$res->{$PASS_APPEARS}}));
766 printf " | %-40s | %7d |\n", $PASS_UNSUPPORTED, scalar(@{$res->{$PASS_UNSUPPORTED}}) if (scalar(@{$res->{$PASS_UNSUPPORTED}}));
767 printf " | %-40s | %7d |\n", $PASS_UNTESTED, scalar(@{$res->{$PASS_UNTESTED}}) if (scalar(@{$res->{$PASS_UNTESTED}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200768 printf " | %-40s | %7d |\n", $XPASS_PASS, scalar(@{$res->{$XPASS_PASS}}) if (scalar(@{$res->{$XPASS_PASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200769 printf " | %-40s | %7d |\n", $XPASS_XFAIL, scalar(@{$res->{$XPASS_XFAIL}}) if (scalar(@{$res->{$XPASS_XFAIL}}));
770 printf " | %-40s | %7d |\n", $XPASS_UNSUPPORTED, scalar(@{$res->{$XPASS_UNSUPPORTED}}) if (scalar(@{$res->{$XPASS_UNSUPPORTED}}));
771 printf " | %-40s | %7d |\n", $XPASS_UNTESTED, scalar(@{$res->{$XPASS_UNTESTED}}) if (scalar(@{$res->{$XPASS_UNTESTED}}));
772 printf " | %-40s | %7d |\n", $XPASS_DISAPPEARS, scalar(@{$res->{$XPASS_DISAPPEARS}}) if (scalar(@{$res->{$XPASS_DISAPPEARS}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200773 printf " | %-40s | %7d |\n", $FAIL_PASS, scalar(@{$res->{$FAIL_PASS}}) if (scalar(@{$res->{$FAIL_PASS}}));
774 printf " | %-40s | %7d |\n", $FAIL_XPASS, scalar(@{$res->{$FAIL_XPASS}}) if (scalar(@{$res->{$FAIL_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200775 printf " | %-40s | %7d |\n", $FAIL_XFAIL, scalar(@{$res->{$FAIL_XFAIL}}) if (scalar(@{$res->{$FAIL_XFAIL}}));
776 printf " | %-40s | %7d |\n", $FAIL_UNSUPPORTED, scalar(@{$res->{$FAIL_UNSUPPORTED}}) if (scalar(@{$res->{$FAIL_UNSUPPORTED}}));
777 printf " | %-40s | %7d |\n", $FAIL_UNTESTED, scalar(@{$res->{$FAIL_UNTESTED}}) if (scalar(@{$res->{$FAIL_UNTESTED}}));
778 printf " | %-40s | %7d |\n", $FAIL_DISAPPEARS, scalar(@{$res->{$FAIL_DISAPPEARS}}) if (scalar(@{$res->{$FAIL_DISAPPEARS}}));
779 printf " | %-40s | %7d |\n", $XFAIL_PASS, scalar(@{$res->{$XFAIL_PASS}}) if (scalar(@{$res->{$XFAIL_PASS}}));
780 printf " | %-40s | %7d |\n", $XFAIL_XPASS, scalar(@{$res->{$XFAIL_XPASS}}) if (scalar(@{$res->{$XFAIL_XPASS}}));
781 printf " | %-40s | %7d |\n", $XFAIL_UNSUPPORTED, scalar(@{$res->{$XFAIL_UNSUPPORTED}}) if (scalar(@{$res->{$XFAIL_UNSUPPORTED}}));
782 printf " | %-40s | %7d |\n", $XFAIL_UNTESTED, scalar(@{$res->{$XFAIL_UNTESTED}}) if (scalar(@{$res->{$XFAIL_UNTESTED}}));
783 printf " | %-40s | %7d |\n", $XFAIL_APPEARS, scalar(@{$res->{$XFAIL_APPEARS}}) if (scalar(@{$res->{$XFAIL_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100784 printf " | %-40s | %7d |\n", $UNSUPPORTED_PASS, scalar(@{$res->{$UNSUPPORTED_PASS}}) if (scalar(@{$res->{$UNSUPPORTED_PASS}}));
785 printf " | %-40s | %7d |\n", $UNSUPPORTED_XFAIL, scalar(@{$res->{$UNSUPPORTED_XFAIL}}) if (scalar(@{$res->{$UNSUPPORTED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200786 printf " | %-40s | %7d |\n", $UNSUPPORTED_UNTESTED, scalar(@{$res->{$UNSUPPORTED_UNTESTED}}) if (scalar(@{$res->{$UNSUPPORTED_UNTESTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100787 printf " | %-40s | %7d |\n", $UNSUPPORTED_DISAPPEARS, scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200788 printf " | %-40s | %7d |\n", $UNSUPPORTED_APPEARS, scalar(@{$res->{$UNSUPPORTED_APPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100789 printf " | %-40s | %7d |\n", $UNTESTED_PASS, scalar(@{$res->{$UNTESTED_PASS}}) if (scalar(@{$res->{$UNTESTED_PASS}}));
790 printf " | %-40s | %7d |\n", $UNTESTED_XFAIL, scalar(@{$res->{$UNTESTED_XFAIL}}) if (scalar(@{$res->{$UNTESTED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200791 printf " | %-40s | %7d |\n", $UNTESTED_UNSUPPORTED, scalar(@{$res->{$UNTESTED_UNSUPPORTED}}) if (scalar(@{$res->{$UNTESTED_UNSUPPORTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100792 printf " | %-40s | %7d |\n", $UNTESTED_DISAPPEARS, scalar(@{$res->{$UNTESTED_DISAPPEARS}}) if (scalar(@{$res->{$UNTESTED_DISAPPEARS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200793 printf " | %-40s | %7d |\n", $UNTESTED_APPEARS, scalar(@{$res->{$UNTESTED_APPEARS}}) if (scalar(@{$res->{$UNTESTED_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100794 printf " | %-40s | %7d |\n", $UNRESOLVED_PASS, scalar(@{$res->{$UNRESOLVED_PASS}}) if (scalar(@{$res->{$UNRESOLVED_PASS}}));
795 printf " | %-40s | %7d |\n", $UNRESOLVED_XFAIL, scalar(@{$res->{$UNRESOLVED_XFAIL}}) if (scalar(@{$res->{$UNRESOLVED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200796 printf " | %-40s | %7d |\n", $UNRESOLVED_UNSUPPORTED, scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}) if (scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}));
797 printf " | %-40s | %7d |\n", $UNRESOLVED_UNTESTED, scalar(@{$res->{$UNRESOLVED_UNTESTED}}) if (scalar(@{$res->{$UNRESOLVED_UNTESTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100798 printf " | %-40s | %7d |\n", $UNRESOLVED_DISAPPEARS, scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}) if (scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}));
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200799 printf " | %-40s | %7d |\n", $ERROR_DISAPPEARS, scalar(@{$res->{$ERROR_DISAPPEARS}}) if (scalar(@{$res->{$ERROR_DISAPPEARS}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100800 printf " | %-40s | %7d |\n", $UNHANDLED_CASES, scalar(@{$res->{$UNHANDLED_CASES}}) if (scalar(@{$res->{$UNHANDLED_CASES}}));
801 printf " | %-40s | %7d |\n", $UNSTABLE_CASES, scalar(@{$res->{$UNSTABLE_CASES}}) if (scalar(@{$res->{$UNSTABLE_CASES}}));
802 printf " +------------------------------------------+---------+\n";
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100803 printf " | %-40s | %7d |\n", "TOTAL_MINOR_TO_BE_CHECKED", $total_better + scalar(@{$res->{$UNSTABLE_CASES}});;
Christophe Lyonbff39612015-11-18 16:29:11 +0100804 printf " +------------------------------------------+---------+\n";
805 printf "\n";
806
807 if ($long)
808 {
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000809 # When testcases disappear, make sure to pass $ref as 1st argument
810 print_tclist($ref, $PASS_DISAPPEARS, @{$res->{$PASS_DISAPPEARS}});
811 print_tclist($res, $PASS_XFAIL, @{$res->{$PASS_XFAIL}});
812 print_tclist($res, $PASS_APPEARS, @{$res->{$PASS_APPEARS}});
813 print_tclist($res, $PASS_UNSUPPORTED, @{$res->{$PASS_UNSUPPORTED}});
814 print_tclist($res, $PASS_UNTESTED, @{$res->{$PASS_UNTESTED}});
815 print_tclist($res, $XPASS_PASS, @{$res->{$XPASS_PASS}});
816 print_tclist($res, $XPASS_XFAIL, @{$res->{$XPASS_XFAIL}});
817 print_tclist($res, $XPASS_UNSUPPORTED, @{$res->{$XPASS_UNSUPPORTED}});
818 print_tclist($res, $XPASS_UNTESTED, @{$res->{$XPASS_UNTESTED}});
819 # When testcases disappear, make sure to pass $ref as 1st argument
820 print_tclist($ref, $XPASS_DISAPPEARS, @{$res->{$XPASS_DISAPPEARS}});
821 print_tclist($res, $XFAIL_PASS, @{$res->{$XFAIL_PASS}});
822 print_tclist($res, $XFAIL_XPASS, @{$res->{$XFAIL_XPASS}});
823 print_tclist($res, $FAIL_PASS, @{$res->{$FAIL_PASS}});
824 print_tclist($res, $FAIL_XPASS, @{$res->{$FAIL_XPASS}});
825 print_tclist($res, $FAIL_XFAIL, @{$res->{$FAIL_XFAIL}});
826 print_tclist($res, $FAIL_UNSUPPORTED, @{$res->{$FAIL_UNSUPPORTED}});
827 print_tclist($res, $FAIL_UNTESTED, @{$res->{$FAIL_UNTESTED}});
828 # When testcases disappear, make sure to pass $ref as 1st argument
829 print_tclist($ref, $FAIL_DISAPPEARS, @{$res->{$FAIL_DISAPPEARS}});
830 print_tclist($res, $XFAIL_PASS, @{$res->{$XFAIL_PASS}});
831 print_tclist($res, $XFAIL_XPASS, @{$res->{$XFAIL_XPASS}});
832 print_tclist($res, $XFAIL_UNSUPPORTED, @{$res->{$XFAIL_UNSUPPORTED}});
833 print_tclist($res, $XFAIL_UNTESTED, @{$res->{$XFAIL_UNTESTED}});
834 print_tclist($res, $XFAIL_APPEARS, @{$res->{$XFAIL_APPEARS}});
835 print_tclist($res, $UNSUPPORTED_PASS, @{$res->{$UNSUPPORTED_PASS}});
836 print_tclist($res, $UNSUPPORTED_XFAIL, @{$res->{$UNSUPPORTED_XFAIL}});
837 print_tclist($res, $UNSUPPORTED_UNTESTED, @{$res->{$UNSUPPORTED_UNTESTED}});
838 # When testcases disappear, make sure to pass $ref as 1st argument
839 print_tclist($ref, $UNSUPPORTED_DISAPPEARS, @{$res->{$UNSUPPORTED_DISAPPEARS}});
840 print_tclist($res, $UNSUPPORTED_APPEARS, @{$res->{$UNSUPPORTED_APPEARS}});
841 print_tclist($res, $UNTESTED_PASS, @{$res->{$UNTESTED_PASS}});
842 print_tclist($res, $UNTESTED_XFAIL, @{$res->{$UNTESTED_XFAIL}});
843 print_tclist($res, $UNTESTED_UNSUPPORTED, @{$res->{$UNTESTED_UNSUPPORTED}});
844 # When testcases disappear, make sure to pass $ref as 1st argument
845 print_tclist($ref, $UNTESTED_DISAPPEARS, @{$res->{$UNTESTED_DISAPPEARS}});
846 print_tclist($res, $UNTESTED_APPEARS, @{$res->{$UNTESTED_APPEARS}});
847 print_tclist($res, $UNRESOLVED_PASS, @{$res->{$UNRESOLVED_PASS}});
848 print_tclist($res, $UNRESOLVED_XFAIL, @{$res->{$UNRESOLVED_XFAIL}});
849 print_tclist($res, $UNRESOLVED_UNSUPPORTED, @{$res->{$UNRESOLVED_UNSUPPORTED}});
850 print_tclist($res, $UNRESOLVED_UNTESTED, @{$res->{$UNRESOLVED_UNTESTED}});
851 # When testcases disappear, make sure to pass $ref as 1st argument
852 print_tclist($ref, $UNRESOLVED_DISAPPEARS, @{$res->{$UNRESOLVED_DISAPPEARS}});
853 print_tclist($ref, $ERROR_DISAPPEARS, @{$res->{$ERROR_DISAPPEARS}});
854 print_tclist($res, $UNHANDLED_CASES, @{$res->{$UNHANDLED_CASES}});
855 print_tclist($res, $UNSTABLE_CASES, @{$res->{$UNSTABLE_CASES}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100856 }
857 printf "$col_reset\n";
858 }
859
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100860 $return_value = 1 if ($total_better);
Christophe Lyonbff39612015-11-18 16:29:11 +0100861
862 $return_value = 2 if ($rtotal);
863
Christophe Lyond618f662016-02-02 19:07:58 +0100864 # Error if there was no PASS (eg when sth went wrong and no .sum was generated)
865 $return_value = 2 if (($res->{PASS} + $res->{XFAIL}) == 0);
866
867 # Error if every test passed, or the ratio was too low. This
868 # generally means the simulator is not configured well.
869 $return_value = 2 if (($ref_ratio == 100) || ($ref_ratio < $ratio_thresh));
870 $return_value = 2 if (($res_ratio == 100) || ($res_ratio < $ratio_thresh));
Christophe Lyonbff39612015-11-18 16:29:11 +0100871
Christophe Lyonad8c7242016-02-03 13:04:28 +0100872 # Error if no execution test passed.
873 # It is possible that no execution test fails, though.
874 $return_value = 2 if (($ignore_exec == 0)
875 && (($ref->{EXEC}->{PASS} == 0)
876 || ($res->{EXEC}->{PASS} == 0)));
877
Christophe Lyonbff39612015-11-18 16:29:11 +0100878 return $return_value;
879}