blob: 388db899335d2954a0d2dca752b30b9fdc827789 [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 Lyon73ac1d82018-06-12 13:32:47 +000097my $HWDEP_CASES = "HW dependent cases [HW-DEPENDENT]";
Christophe Lyonbff39612015-11-18 16:29:11 +010098
Christophe Lyon73ac1d82018-06-12 13:32:47 +000099# Handle status transitions:
100# 'was' is the reference status
101# 'is' is the current status
102# 'cat' is the short name for the transition type
103# 'handler' is a function handling the transition, if non-trivial
104# report_hwdep is a boolean controlling whether to report the
105# transition even if flagged as hardware-dependent
Christophe Lyonbff39612015-11-18 16:29:11 +0100106my @handler_list = (
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000107 {was=>"PASS", is=>"PASS", cat=>$PASS_PASS, report_hwdep=>"false"},
108 {was=>"PASS", is=>"XPASS", cat=>$PASS_XPASS, report_hwdep=>"true"},
109 {was=>"PASS", is=>"FAIL", handler=>\&handle_pass_fail, report_hwdep=>"true"},
110 {was=>"PASS", is=>"XFAIL", cat=>$PASS_XFAIL, report_hwdep=>"true"},
111 {was=>"PASS", is=>"UNSUPPORTED",cat=>$PASS_UNSUPPORTED, report_hwdep=>"false"},
112 {was=>"PASS", is=>"UNTESTED", cat=>$PASS_UNTESTED, report_hwdep=>"true"},
113 {was=>"PASS", is=>"UNRESOLVED",cat=>$PASS_UNRESOLVED, report_hwdep=>"true"},
114 {was=>"PASS", is=>"NO_EXIST", cat=>$PASS_DISAPPEARS, report_hwdep=>"false"},
115 {was=>"NO_EXIST", is=>"PASS", cat=>$PASS_APPEARS, report_hwdep=>"false"},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200116
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000117 {was=>"XPASS", is=>"PASS", cat=>$XPASS_PASS, report_hwdep=>"true"},
118 {was=>"XPASS", is=>"XPASS", cat=>$XPASS_XPASS, report_hwdep=>"true"},
119 {was=>"XPASS", is=>"FAIL", cat=>$XPASS_FAIL, report_hwdep=>"true"},
120 {was=>"XPASS", is=>"XFAIL", cat=>$XPASS_XFAIL, report_hwdep=>"true"},
121 {was=>"XPASS", is=>"UNSUPPORTED",cat=>$XPASS_UNSUPPORTED, report_hwdep=>"true"},
122 {was=>"XPASS", is=>"UNTESTED", cat=>$XPASS_UNTESTED, report_hwdep=>"true"},
123 {was=>"XPASS", is=>"UNRESOLVED",cat=>$XPASS_UNRESOLVED, report_hwdep=>"true"},
124 {was=>"XPASS", is=>"NO_EXIST", cat=>$XPASS_DISAPPEARS, report_hwdep=>"true"},
125 {was=>"NO_EXIST", is=>"XPASS", cat=>$XPASS_APPEARS, report_hwdep=>"true"},
Christophe Lyonbff39612015-11-18 16:29:11 +0100126
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000127 {was=>"FAIL", is=>"PASS", cat=>$FAIL_PASS, report_hwdep=>"true"},
128 {was=>"FAIL", is=>"XPASS", cat=>$FAIL_XPASS, report_hwdep=>"true"},
129 {was=>"FAIL", is=>"FAIL", cat=>$FAIL_FAIL, report_hwdep=>"true"},
130 {was=>"FAIL", is=>"XFAIL", cat=>$FAIL_XFAIL, report_hwdep=>"true"},
131 {was=>"FAIL", is=>"UNSUPPORTED",cat=>$FAIL_UNSUPPORTED, report_hwdep=>"true"},
132 {was=>"FAIL", is=>"UNTESTED", cat=>$FAIL_UNTESTED, report_hwdep=>"true"},
133 {was=>"FAIL", is=>"UNRESOLVED",cat=>$FAIL_UNRESOLVED, report_hwdep=>"true"},
134 {was=>"FAIL", is=>"NO_EXIST", cat=>$FAIL_DISAPPEARS, report_hwdep=>"true"},
135 {was=>"NO_EXIST", is=>"FAIL", cat=>$FAIL_APPEARS, report_hwdep=>"true"},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200136
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000137 {was=>"XFAIL", is=>"PASS", cat=>$XFAIL_PASS, report_hwdep=>"true"},
138 {was=>"XFAIL", is=>"XPASS", cat=>$XFAIL_XPASS, report_hwdep=>"true"},
139 {was=>"XFAIL", is=>"FAIL", cat=>$XFAIL_FAIL, report_hwdep=>"true"},
140 {was=>"XFAIL", is=>"XFAIL", cat=>$XFAIL_XFAIL, report_hwdep=>"true"},
141 {was=>"XFAIL", is=>"UNSUPPORTED",cat=>$XFAIL_UNSUPPORTED, report_hwdep=>"true"},
142 {was=>"XFAIL", is=>"UNTESTED", cat=>$XFAIL_UNTESTED, report_hwdep=>"true"},
143 {was=>"XFAIL", is=>"UNRESOLVED",cat=>$XFAIL_UNRESOLVED, report_hwdep=>"true"},
144 {was=>"XFAIL", is=>"NO_EXIST", cat=>$XFAIL_DISAPPEARS, report_hwdep=>"true"},
145 {was=>"NO_EXIST", is=>"XFAIL", cat=>$XFAIL_APPEARS, report_hwdep=>"true"},
Christophe Lyonbff39612015-11-18 16:29:11 +0100146
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000147 {was=>"UNSUPPORTED", is=>"PASS", cat=>$UNSUPPORTED_PASS, report_hwdep=>"true"},
148 {was=>"UNSUPPORTED", is=>"XPASS", cat=>$UNSUPPORTED_XPASS, report_hwdep=>"true"},
149 {was=>"UNSUPPORTED", is=>"FAIL", cat=>$UNSUPPORTED_FAIL, report_hwdep=>"true"},
150 {was=>"UNSUPPORTED", is=>"XFAIL", cat=>$UNSUPPORTED_XFAIL, report_hwdep=>"true"},
151 {was=>"UNSUPPORTED", is=>"UNSUPPORTED",cat=>$UNSUPPORTED_UNSUPPORTED, report_hwdep=>"true"},
152 {was=>"UNSUPPORTED", is=>"UNTESTED", cat=>$UNSUPPORTED_UNTESTED, report_hwdep=>"true"},
153 {was=>"UNSUPPORTED", is=>"UNRESOLVED",cat=>$UNSUPPORTED_UNRESOLVED, report_hwdep=>"true"},
154 {was=>"UNSUPPORTED", is=>"NO_EXIST", cat=>$UNSUPPORTED_DISAPPEARS, report_hwdep=>"true"},
155 {was=>"NO_EXIST", is=>"UNSUPPORTED", cat=>$UNSUPPORTED_APPEARS, report_hwdep=>"true"},
Christophe Lyona140aa82015-12-17 22:53:03 +0100156
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000157 {was=>"UNTESTED", is=>"PASS", cat=>$UNTESTED_PASS, report_hwdep=>"true"},
158 {was=>"UNTESTED", is=>"XPASS", cat=>$UNTESTED_XPASS, report_hwdep=>"true"},
159 {was=>"UNTESTED", is=>"FAIL", cat=>$UNTESTED_FAIL, report_hwdep=>"true"},
160 {was=>"UNTESTED", is=>"XFAIL", cat=>$UNTESTED_XFAIL, report_hwdep=>"true"},
161 {was=>"UNTESTED", is=>"UNSUPPORTED",cat=>$UNTESTED_UNSUPPORTED,report_hwdep=>"true"},
162 {was=>"UNTESTED", is=>"UNTESTED", cat=>$UNTESTED_UNTESTED, report_hwdep=>"true"},
163 {was=>"UNTESTED", is=>"UNRESOLVED",cat=>$UNTESTED_UNRESOLVED, report_hwdep=>"true"},
164 {was=>"UNTESTED", is=>"NO_EXIST", cat=>$UNTESTED_DISAPPEARS, report_hwdep=>"true"},
165 {was=>"NO_EXIST", is=>"UNTESTED", cat=>$UNTESTED_APPEARS, report_hwdep=>"true"},
Christophe Lyona140aa82015-12-17 22:53:03 +0100166
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000167 {was=>"UNRESOLVED", is=>"PASS", cat=>$UNRESOLVED_PASS, report_hwdep=>"true"},
168 {was=>"UNRESOLVED", is=>"XPASS", cat=>$UNRESOLVED_XPASS, report_hwdep=>"true"},
169 {was=>"UNRESOLVED", is=>"FAIL", cat=>$UNRESOLVED_FAIL, report_hwdep=>"true"},
170 {was=>"UNRESOLVED", is=>"XFAIL", cat=>$UNRESOLVED_XFAIL, report_hwdep=>"true"},
171 {was=>"UNRESOLVED", is=>"UNSUPPORTED",cat=>$UNRESOLVED_UNSUPPORTED, report_hwdep=>"true"},
172 {was=>"UNRESOLVED", is=>"UNTESTED", cat=>$UNRESOLVED_UNTESTED, report_hwdep=>"true"},
173 {was=>"UNRESOLVED", is=>"UNRESOLVED",cat=>$UNRESOLVED_UNRESOLVED, report_hwdep=>"true"},
174 {was=>"UNRESOLVED", is=>"NO_EXIST", cat=>$UNRESOLVED_DISAPPEARS, report_hwdep=>"true"},
175 {was=>"NO_EXIST", is=>"UNRESOLVED", cat=>$UNRESOLVED_APPEARS, report_hwdep=>"true"},
Christophe Lyondc66fc52016-04-05 17:38:07 +0200176
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000177 {was=>"ERROR", is=>"NO_EXIST", cat=>$ERROR_DISAPPEARS, report_hwdep=>"true"},
178 {was=>"NO_EXIST", is=>"ERROR", cat=>$ERROR_APPEARS, report_hwdep=>"true"},
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200179
Christophe Lyonbff39612015-11-18 16:29:11 +0100180# {was=>"NO_EXIST", is=>"NO_EXIST", handler=>\&handle_not_yet_supported}
181);
182
183######################################################
184# TREAT ARGUMENTS
185
186my $verbose=0;
187my $quiet=0;
188my $long=0;
189my $short=0;
190my $debug=0;
191my ($testroot, $basename);
192my ($ref_file_name, $res_file_name);
193my $nounstable=0;
194my $unstablefile=0;
195my @unstable_markers=();
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000196
197my $no_hwdep=0; # Ignore hw-dependent flag (ie. consider all tests as *not* hw-dependent
198my $hwdep_file=0; # File containing the list of hw-dependent tests
199my @hwdep_markers=(); # Optional markers when parsing hwdep_file
200
Christophe Lyonca9d8302017-05-22 12:04:00 +0000201my $ratio_thresh = 0.95; # Warn if pass ratio is below this threshold
Christophe Lyonbff39612015-11-18 16:29:11 +0100202
203GetOptions ("l" => \$long,
204 "s" => \$short,
205 "q" => \$quiet,
206 "v" => \$verbose,
207 "dbg" => \$debug,
208 "testroot=s" => \$testroot,
209 "basename=s" => \$basename,
Christophe Lyonca9d8302017-05-22 12:04:00 +0000210 "pass-thresh=f" => \$ratio_thresh,
Christophe Lyonbff39612015-11-18 16:29:11 +0100211 "no-unstable" => \$nounstable,
212 "unstable-tests=s" => \$unstablefile,
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000213 "unstable-marker=s" => \@unstable_markers,
214 "no-hwdep" => \$no_hwdep,
215 "hwdep-tests=s" => \$hwdep_file,
216 "hwdep-marker=s" => \@hwdep_markers);
Christophe Lyonbff39612015-11-18 16:29:11 +0100217
218$ref_file_name = $ARGV[0] if ($#ARGV == 1);
219$res_file_name = $ARGV[1] if ($#ARGV == 1);
220
221$ref_file_name = $testroot."/expected_results/".$basename if ($testroot and $basename);
222$res_file_name = $testroot."/testing/run/".$basename if ($testroot and $basename);
223&usage if (not $ref_file_name or not $res_file_name);
224
225my ($col_boldred, $col_red, $col_boldgreen, $col_green, $col_boldpink, $col_pink, $col_reset)
226 = ("\033[31;1m","\033[31;3m","\033[32;1m","\033[32;3m","\033[35;1m","\033[35;2m","\033[0m");
227($col_boldred, $col_red, $col_boldgreen, $col_green, $col_boldpink, $col_pink, $col_reset)
228 = ("","","","","","","") if (not I_am_interactive());
229
230######################################################
231# MAIN PROGRAM
232# print "comparing $ref_file_name $res_file_name\n";
233
234# If none of the 2 .sum exists, nothing to compare: exit early.
235exit 0 if ( (! -e $ref_file_name) && (! -e $res_file_name ));
236
237my $ref = read_sum($ref_file_name) ;
238my $res = read_sum($res_file_name) ;
239my @unstablelist = ();
240
241@unstablelist = read_unstable($unstablefile) if ($unstablefile ne 0);
242
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000243# Import list of hw-dependent files, if provided
244my @hwdep_list = ();
245
246@hwdep_list = read_unstable($hwdep_file) if ($hwdep_file ne 0);
247
Christophe Lyonbff39612015-11-18 16:29:11 +0100248compare_results($ref, $res);
249
250my $final_result = print_compare_results_summary($ref, $res);
251
252exit $final_result;
253
254######################################################
255# UTILITIES
256
257sub empty_result()
258{
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200259 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 +0100260 $empty_result{PASS}=$empty_result{FAIL}=$empty_result{XPASS}=$empty_result{XFAIL}=0;
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200261 $empty_result{UNSUPPORTED}=$empty_result{UNTESTED}=$empty_result{UNRESOLVED}=$empty_result{NO_EXIST}=$empty_result{ERROR}=0;
Christophe Lyonbff39612015-11-18 16:29:11 +0100262 return \%empty_result;
263}
264sub I_am_interactive {
265 return -t STDIN && -t STDOUT;
266}
267sub usage()
268{
269 print "Usage : $app <ref_file.sum> <result_file.sum>\n";
270 exit 1;
271}
272
273
274######################################################
275# PARSING
276sub read_sum($)
277{
278 my ($sum_file) = @_;
279 my $res = empty_result();
280 my %testcases;
281 my %unsupported;
282 $res->{testcases} = \%testcases;
283 my $pending_timeout=0;
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000284 my $current_exp="";
Christophe Lyonbff39612015-11-18 16:29:11 +0100285
Christophe Lyonad8c7242016-02-03 13:04:28 +0100286 $res->{EXEC}->{PASS} = 0;
287 $res->{EXEC}->{FAIL} = 0;
288
Christophe Lyonbff39612015-11-18 16:29:11 +0100289 open SUMFILE, $sum_file or die $!;
290 while (<SUMFILE>)
291 {
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000292 if (m/^(PASS|XPASS|FAIL|XFAIL|UNSUPPORTED|UNTESTED|UNRESOLVED|ERROR): *(.*)/)
Christophe Lyonbff39612015-11-18 16:29:11 +0100293 {
294 my ($diag,$tc) = ($1,$2);
295 my %tcresult;
296 $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./;
297 $testcases{$tc} = empty_result() if (not exists $testcases{$tc});
298 $testcases{$tc}->{$diag}++;
299 $testcases{$tc}->{HAS_TIMED_OUT} = $pending_timeout;
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000300 $testcases{$tc}->{EXP} = $current_exp;
Christophe Lyonbff39612015-11-18 16:29:11 +0100301 $pending_timeout = 0;
302 $res->{$diag}++;
Christophe Lyonad8c7242016-02-03 13:04:28 +0100303 # Count execution tests, for a sanity check
304 if ($tc =~ /execution/)
305 {
306 $res->{EXEC}->{$diag}++;
307 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100308 }
309 elsif (m/WARNING: program timed out/)
310 {
311 $pending_timeout = 1;
312 }
313 elsif (m/^(# of expected passes|# of unexpected failures|# of expected failures|# of known failures|# of unsupported tests|# of untested testcases)\s+(.*)/)
314 {
315 $res->{"summary - "."$1"} = $2;
316 }
317 elsif (m/^\/.*\/([^\/]+)\s+version\s+(.*)/)
318 {
319 $res->{tool} = $1;
320 $res->{version} = $2;
321 $res->{version} =~ s/ [-(].*//;
322 }
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000323 elsif (m/^Running target .*/)
324 {
325 }
326 elsif (m/^Running (.*) \.\.\.*/)
327 {
328 $current_exp=$1;
329 $current_exp =~ s|.*/testsuite/||;
330 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100331 }
332 close SUMFILE;
333 return $res;
334}
335
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000336# Parse list of unstable/hw-dependent tests
Christophe Lyonbff39612015-11-18 16:29:11 +0100337sub read_unstable($)
338{
339 my ($unstable_file) = @_;
340 my @unstable_tests = ();
341
342 open UNSTABLEFILE, $unstable_file or die $!;
343 while (<UNSTABLEFILE>)
344 {
345 # Skip lines starting with '#', or with spaces only
346 if ((/^#/) || (/^[ ]*$/))
347 {
348 }
349 else
350 {
351 chomp;
352
353 my $test = $_;
354
355 # Check if line is of type: target:testname
Christophe Lyon5e7241c2015-12-04 12:57:27 +0100356 if (/^(.*?):/)
Christophe Lyonbff39612015-11-18 16:29:11 +0100357 {
358 foreach my $unstable_marker (@unstable_markers)
359 {
360 if ($unstable_marker eq $1) {
361 # If target matches the one supplied as script
362 # argument, add the testname to the list
Christophe Lyon5e7241c2015-12-04 12:57:27 +0100363 $test =~ s/.*?://;
Christophe Lyonbff39612015-11-18 16:29:11 +0100364 push @unstable_tests, $test;
365 }
366 }
367 } else {
368 push @unstable_tests, $test;
369 }
370 }
371 }
372 close UNSTABLEFILE;
373 return @unstable_tests;
374}
375
376######################################################
377# DIFFING
378sub handle_pass_fail($$$$)
379{
380 my ($ref, $res, $diag_diag, $tc) = @_;
381 if ($res->{testcases}->{$tc}->{HAS_TIMED_OUT})
382 {
383 push @{$res->{$PASSED_NOW_TIMEOUTS}}, $tc;
384 }
385 else
386 {
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000387 # This transition is flagged as hw-dependent if:
388 # - the name is in the list
389 # - the transition should not be reported (but be flagged as hw-dependent instead)
390 # - --no-hwdep was not provided
391 if ((grep { (index $tc,$_)!=-1} @hwdep_list)
392 && ($diag_diag->{report_hwdep} eq "false")
393 && ($no_hwdep == 0)) {
394 push @{$res->{$HWDEP_CASES}}, $tc;
395 } else {
396 push @{$res->{$PASS_FAIL}}, $tc;
397 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100398 }
399}
400
401sub compare_results($$)
402{
403 my ($ref, $res) = @_;
404
Christophe Lyondded4d82016-06-28 18:12:38 +0200405 @{$res->{$PASS_PASS}} = ();
Christophe Lyondded4d82016-06-28 18:12:38 +0200406 @{$res->{$PASS_XPASS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200407 @{$res->{$PASS_FAIL}} = ();
408 @{$res->{$PASS_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200409 @{$res->{$PASS_UNSUPPORTED}} = ();
410 @{$res->{$PASS_UNTESTED}} = ();
411 @{$res->{$PASS_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200412 @{$res->{$PASS_DISAPPEARS}} = ();
413 @{$res->{$PASS_APPEARS}} = ();
414 @{$res->{$PASSED_NOW_TIMEOUTS}} = ();
415
Christophe Lyondded4d82016-06-28 18:12:38 +0200416 @{$res->{$XPASS_PASS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200417 @{$res->{$XPASS_XPASS}} = ();
418 @{$res->{$XPASS_FAIL}} = ();
419 @{$res->{$XPASS_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200420 @{$res->{$XPASS_UNSUPPORTED}} = ();
421 @{$res->{$XPASS_UNTESTED}} = ();
422 @{$res->{$XPASS_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200423 @{$res->{$XPASS_DISAPPEARS}} = ();
424 @{$res->{$XPASS_APPEARS}} = ();
425
426 @{$res->{$FAIL_PASS}} = ();
427 @{$res->{$FAIL_XPASS}} = ();
428 @{$res->{$FAIL_FAIL}} = ();
429 @{$res->{$FAIL_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200430 @{$res->{$FAIL_UNSUPPORTED}} = ();
431 @{$res->{$FAIL_UNTESTED}} = ();
432 @{$res->{$FAIL_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200433 @{$res->{$FAIL_DISAPPEARS}} = ();
434 @{$res->{$FAIL_APPEARS}} = ();
435
Christophe Lyondded4d82016-06-28 18:12:38 +0200436 @{$res->{$XFAIL_PASS}} = ();
437 @{$res->{$XFAIL_XPASS}} = ();
438 @{$res->{$XFAIL_FAIL}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200439 @{$res->{$XFAIL_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200440 @{$res->{$XFAIL_UNSUPPORTED}} = ();
441 @{$res->{$XFAIL_UNTESTED}} = ();
442 @{$res->{$XFAIL_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200443 @{$res->{$XFAIL_DISAPPEARS}} = ();
444 @{$res->{$XFAIL_APPEARS}} = ();
445
Christophe Lyona140aa82015-12-17 22:53:03 +0100446 @{$res->{$UNSUPPORTED_PASS}} = ();
447 @{$res->{$UNSUPPORTED_XPASS}} = ();
448 @{$res->{$UNSUPPORTED_FAIL}} = ();
449 @{$res->{$UNSUPPORTED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200450 @{$res->{$UNSUPPORTED_UNSUPPORTED}} = ();
451 @{$res->{$UNSUPPORTED_UNTESTED}} = ();
452 @{$res->{$UNSUPPORTED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100453 @{$res->{$UNSUPPORTED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200454 @{$res->{$UNSUPPORTED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200455
Christophe Lyona140aa82015-12-17 22:53:03 +0100456 @{$res->{$UNTESTED_PASS}} = ();
457 @{$res->{$UNTESTED_XPASS}} = ();
458 @{$res->{$UNTESTED_FAIL}} = ();
459 @{$res->{$UNTESTED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200460 @{$res->{$UNTESTED_UNSUPPORTED}} = ();
461 @{$res->{$UNTESTED_UNTESTED}} = ();
462 @{$res->{$UNTESTED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100463 @{$res->{$UNTESTED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200464 @{$res->{$UNTESTED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200465
Christophe Lyona140aa82015-12-17 22:53:03 +0100466 @{$res->{$UNRESOLVED_PASS}} = ();
467 @{$res->{$UNRESOLVED_XPASS}} = ();
468 @{$res->{$UNRESOLVED_FAIL}} = ();
469 @{$res->{$UNRESOLVED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200470 @{$res->{$UNRESOLVED_UNSUPPORTED}} = ();
471 @{$res->{$UNRESOLVED_UNTESTED}} = ();
472 @{$res->{$UNRESOLVED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100473 @{$res->{$UNRESOLVED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200474 @{$res->{$UNRESOLVED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200475
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200476 @{$res->{$ERROR_DISAPPEARS}} = ();
477 @{$res->{$ERROR_APPEARS}} = ();
478
Christophe Lyonbff39612015-11-18 16:29:11 +0100479 @{$res->{$UNHANDLED_CASES}} = ();
480 @{$res->{$UNSTABLE_CASES}} = ();
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000481 @{$res->{$HWDEP_CASES}} = ();
Christophe Lyonbff39612015-11-18 16:29:11 +0100482
483 #### MERGE REF AND RES
484 foreach my $key (sort (keys %{$res->{testcases}}))
485 {
486 if (not exists $ref->{testcases}->{$key}) {
487 $ref->{testcases}->{$key} = empty_result();
488 $ref->{testcases}->{$key}->{NO_EXIST} = 1;
Christophe Lyon28a92782017-09-13 09:00:39 +0000489 $ref->{testcases}->{$key}->{EXP} = $res->{testcases}->{$key}->{EXP};
Christophe Lyonbff39612015-11-18 16:29:11 +0100490 }
491 }
492 foreach my $key (keys %{$ref->{testcases}})
493 {
494 if (not exists $res->{testcases}->{$key})
495 {
496 $res->{testcases}->{$key} = empty_result();
497 $res->{testcases}->{$key}->{NO_EXIST} = 1;
Christophe Lyon28a92782017-09-13 09:00:39 +0000498 $res->{testcases}->{$key}->{EXP} = $ref->{testcases}->{$key}->{EXP};
Christophe Lyonbff39612015-11-18 16:29:11 +0100499 }
500 }
501
502 #### ACTIONS FOR EACH CASES
503 my %unstable_found;
504
505 foreach my $key (sort (keys %{$ref->{testcases}}))
506 {
507 foreach my $diag_diag (@handler_list)
508 {
509 if ($ref->{testcases}->{$key}->{$diag_diag->{was}} != $res->{testcases}->{$key}->{$diag_diag->{was}}
510 and $res->{testcases}->{$key}->{$diag_diag->{is}})
511 {
Christophe Lyondc66fc52016-04-05 17:38:07 +0200512 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 Lyon28a92782017-09-13 09:00:39 +0000513 # If testcase is listed as 'unstable' mark it as such
514 # and skip other processing to avoid listing it twice.
Christophe Lyonbff39612015-11-18 16:29:11 +0100515 {
516 if (grep { (index $key,$_)!=-1} @unstablelist)
517 {
518 print "[unstable] $key\n" if ($debug);
519 $unstable_found{$key}=1;
520 }
521 else {
522 print "[$diag_diag->{was} => $diag_diag->{is}] $key\n" if ($debug);
523 if ($diag_diag->{handler})
524 {
525 $diag_diag->{handler} ($ref, $res, $diag_diag, $key);
526 }
527 else
528 {
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000529 # This transition is flagged as hw-dependent if:
530 # - the name is in the list
531 # - the transition should not be reported (but be flagged as hw-dependent instead)
532 # - --no-hwdep was not provided
533 if ((grep { (index $key,$_)!=-1} @hwdep_list)
534 && ($diag_diag->{report_hwdep} eq "false")
535 && ($no_hwdep == 0)) {
536 push @{$res->{$HWDEP_CASES}}, $key;
537 } else {
538 push @{$res->{$diag_diag->{cat}}}, $key;
539 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100540 }
541 }
542 }
543 }
544 }
545 }
546 push @{$res->{$UNSTABLE_CASES}}, (sort (keys (%unstable_found))) if ($nounstable == 0);
547
548}
549
550######################################################
551# PRINTING
552sub print_tclist($@)
553{
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000554 # The 1st parameter is used to find the name of the .exp file
Christophe Lyon28a92782017-09-13 09:00:39 +0000555 # associated with the testcase.
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000556 my ($this_res, $cat, @tclist) = @_;
557 my $this_exp = "";
558 if (scalar(@tclist))
559 {
560 print " - ".$cat.":\n\n";
561 foreach my $case (@tclist)
562 {
563 if ($this_exp ne $this_res->{testcases}->{$case}->{EXP}) {
564 $this_exp = $this_res->{testcases}->{$case}->{EXP};
565 print " Executed from: $this_exp\n";
566 }
567 print " $case\n";
568 }
569 print "\n\n";
570 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100571}
572
573sub print_compare_results_summary($$)
574{
575 my ($ref, $res) = @_;
576 my $return_value=0;
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100577 my $total_better = 0;
Christophe Lyonbff39612015-11-18 16:29:11 +0100578 my $rtotal = 0;
579 my $quiet_reg = $quiet;
Christophe Lyond618f662016-02-02 19:07:58 +0100580 my $ref_ratio = 0;
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200581 my $ref_total = 0;
Christophe Lyond618f662016-02-02 19:07:58 +0100582 my $res_ratio = 0;
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200583 my $res_total = 0;
Christophe Lyonad8c7242016-02-03 13:04:28 +0100584 my $ignore_exec = 0;
585 my $ref_has_exec_tests = 0;
586 my $res_has_exec_tests = 0;
Christophe Lyond618f662016-02-02 19:07:58 +0100587
588 # Compute the pass ratio as a sanity check
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200589 $ref_total = $ref->{PASS} +
590 $ref->{XFAIL} +
591 $ref->{XPASS} +
592 $ref->{FAIL} +
593 $ref->{UNRESOLVED} +
594 $ref->{UNSUPPORTED} +
595 $ref->{UNTESTED};
596
597 # It is possible that no test is executed at all (for instance if
598 # RUNTESTFLAGS was too restrictive). Avoid division by 0.
599 if ($ref_total > 0) {
600 $ref_ratio = ($ref->{PASS} + $ref->{XFAIL}) /
601 $ref_total;
602 }
603
604 $res_total = $res->{PASS} +
605 $res->{XFAIL} +
606 $res->{XPASS} +
607 $res->{FAIL} +
608 $res->{UNRESOLVED} +
609 $res->{UNSUPPORTED} +
610 $res->{UNTESTED};
611
612 if ($res_total > 0) {
613 $res_ratio = ($res->{PASS} + $res->{XFAIL}) /
614 $res_total;
615 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100616
617 if (not $quiet)
618 {
619 printf "Comparing:\n";
620 printf "REFERENCE:$ref_file_name\n";
621 printf "CURRENT: $res_file_name\n\n";
622 }
623
624 #### TESTS STATUS
625 if (not $quiet and not $short)
626 {
627 printf " ` +---------+---------+\n";
Christophe Lyona140aa82015-12-17 22:53:03 +0100628 printf "o RUN STATUS: | REF | RES |\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100629 printf " +------------------------------------------+---------+---------+\n";
Christophe Lyona140aa82015-12-17 22:53:03 +0100630 printf " | %-40s | %7d | %7d |\n", "Passes [PASS]", $ref->{PASS}, $res->{PASS};
Christophe Lyonbff39612015-11-18 16:29:11 +0100631 printf " | %-40s | %7d | %7d |\n", "Unexpected fails [FAIL]", $ref->{FAIL}, $res->{FAIL};
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200632 printf " | %-40s | %7d | %7d |\n", "Errors [ERROR]", $ref->{ERROR}, $res->{ERROR};
Christophe Lyona140aa82015-12-17 22:53:03 +0100633 printf " | %-40s | %7d | %7d |\n", "Unexpected passes [XPASS]", $ref->{XPASS}, $res->{XPASS};
Christophe Lyonbff39612015-11-18 16:29:11 +0100634 printf " | %-40s | %7d | %7d |\n", "Expected fails [XFAIL]", $ref->{XFAIL}, $res->{XFAIL};
635 printf " | %-40s | %7d | %7d |\n", "Unresolved [UNRESOLVED]", $ref->{UNRESOLVED}, $res->{UNRESOLVED};
Christophe Lyona140aa82015-12-17 22:53:03 +0100636 printf " | %-40s | %7d | %7d |\n", "Unsupported [UNSUPPORTED]", $ref->{UNSUPPORTED}, $res->{UNSUPPORTED};
637 printf " | %-40s | %7d | %7d |\n", "Untested [UNTESTED]", $ref->{UNTESTED}, $res->{UNTESTED};
Christophe Lyonbff39612015-11-18 16:29:11 +0100638 printf " +------------------------------------------+---------+---------+\n";
639 printf "\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100640
Christophe Lyon3d195c22016-04-06 16:00:25 +0200641 printf " REF PASS ratio: %f\n", $ref_ratio;
642 printf " RES PASS ratio: %f\n", $res_ratio;
Christophe Lyond618f662016-02-02 19:07:58 +0100643 if ($ref_ratio < $ratio_thresh)
644 {
Christophe Lyon1176f962016-03-03 18:01:10 +0100645 printf " ***** ERROR: REF PASS ratio is abnormally low *****\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100646 }
647 if ($res_ratio < $ratio_thresh)
648 {
Christophe Lyon1176f962016-03-03 18:01:10 +0100649 printf " ***** ERROR: RES PASS ratio is abnormally low *****\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100650 }
651
Christophe Lyonad8c7242016-02-03 13:04:28 +0100652 # If both PASS and FAIL EXEC tests are zero, assume there is no
653 # execution test for this tool, and do not warn.
654 $ref_has_exec_tests = ($ref->{EXEC}->{PASS} + $ref->{EXEC}->{FAIL}) != 0;
655 if ($ref_has_exec_tests)
656 {
657 printf " ***** ERROR: No REF execution test PASSed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{PASS} == 0);
658 printf " ***** WARNING: No REF execution test FAILed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{FAIL} == 0);
659 }
660
661 $res_has_exec_tests = ($res->{EXEC}->{PASS} + $res->{EXEC}->{FAIL}) != 0;
662 if ($res_has_exec_tests)
663 {
664 printf " ***** ERROR: No RES execution test PASSed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{PASS} == 0);
665 printf " ***** WARNING: No RES execution test FAILed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{FAIL} == 0);
666 }
667
668 # Ignore number of execution tests when computing the return
669 # value, if both REF and RES have no execution test.
670 $ignore_exec = !$ref_has_exec_tests && !$res_has_exec_tests;
Christophe Lyonbff39612015-11-18 16:29:11 +0100671 }
672
673 #### REGRESSIONS ?
Christophe Lyon9dde3332016-06-28 23:00:00 +0200674 $rtotal = scalar(@{$res->{$PASS_XPASS}})
675 +scalar(@{$res->{$PASS_FAIL}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200676 +scalar(@{$res->{$PASS_UNRESOLVED}})
677 +scalar(@{$res->{$PASSED_NOW_TIMEOUTS}})
Christophe Lyon30037832018-11-30 15:33:20 +0000678 +scalar(@{$res->{$ERROR_APPEARS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200679 +scalar(@{$res->{$XPASS_FAIL}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100680 +scalar(@{$res->{$XPASS_APPEARS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200681 +scalar(@{$res->{$XPASS_UNRESOLVED}})
682 +scalar(@{$res->{$FAIL_APPEARS}})
683 +scalar(@{$res->{$FAIL_UNRESOLVED}})
Christophe Lyondded4d82016-06-28 18:12:38 +0200684 +scalar(@{$res->{$XFAIL_FAIL}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200685 +scalar(@{$res->{$XFAIL_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100686 +scalar(@{$res->{$UNSUPPORTED_FAIL}})
687 +scalar(@{$res->{$UNSUPPORTED_XPASS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200688 +scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100689 +scalar(@{$res->{$UNTESTED_FAIL}})
690 +scalar(@{$res->{$UNTESTED_XPASS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200691 +scalar(@{$res->{$UNTESTED_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100692 +scalar(@{$res->{$UNRESOLVED_FAIL}})
693 +scalar(@{$res->{$UNRESOLVED_XPASS}})
Christophe Lyon30037832018-11-30 15:33:20 +0000694 +scalar(@{$res->{$UNRESOLVED_APPEARS}});
Christophe Lyona140aa82015-12-17 22:53:03 +0100695
696 $quiet_reg=1 if ($short and not $rtotal);
Christophe Lyonbff39612015-11-18 16:29:11 +0100697
698 if (not $quiet_reg)
699 {
Christophe Lyona140aa82015-12-17 22:53:03 +0100700 printf "\n$col_red"."o REGRESSIONS:\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100701 printf " +------------------------------------------+---------+\n";
Christophe Lyondded4d82016-06-28 18:12:38 +0200702 printf " | %-40s | %7d |\n", $PASS_XPASS, scalar(@{$res->{$PASS_XPASS}}) if (scalar(@{$res->{$PASS_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200703 printf " | %-40s | %7d |\n", $PASS_FAIL, scalar(@{$res->{$PASS_FAIL}}) if (scalar(@{$res->{$PASS_FAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200704 printf " | %-40s | %7d |\n", $PASS_UNRESOLVED, scalar(@{$res->{$PASS_UNRESOLVED}}) if (scalar(@{$res->{$PASS_UNRESOLVED}}));
705 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 +0200706 printf " | %-40s | %7d |\n", $ERROR_APPEARS, scalar(@{$res->{$ERROR_APPEARS}}) if (scalar(@{$res->{$ERROR_APPEARS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200707 printf " | %-40s | %7d |\n", $XPASS_FAIL, scalar(@{$res->{$XPASS_FAIL}}) if (scalar(@{$res->{$XPASS_FAIL}}));
708 printf " | %-40s | %7d |\n", $XPASS_APPEARS, scalar(@{$res->{$XPASS_APPEARS}}) if (scalar(@{$res->{$XPASS_APPEARS}}));
709 printf " | %-40s | %7d |\n", $XPASS_UNRESOLVED, scalar(@{$res->{$XPASS_UNRESOLVED}}) if (scalar(@{$res->{$XPASS_UNRESOLVED}}));
710 printf " | %-40s | %7d |\n", $FAIL_APPEARS, scalar(@{$res->{$FAIL_APPEARS}}) if (scalar(@{$res->{$FAIL_APPEARS}}));
711 printf " | %-40s | %7d |\n", $FAIL_UNRESOLVED, scalar(@{$res->{$FAIL_UNRESOLVED}}) if (scalar(@{$res->{$FAIL_UNRESOLVED}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200712 printf " | %-40s | %7d |\n", $XFAIL_FAIL, scalar(@{$res->{$XFAIL_FAIL}}) if (scalar(@{$res->{$XFAIL_FAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200713 printf " | %-40s | %7d |\n", $XFAIL_UNRESOLVED, scalar(@{$res->{$XFAIL_UNRESOLVED}}) if (scalar(@{$res->{$XFAIL_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100714 printf " | %-40s | %7d |\n", $UNSUPPORTED_FAIL, scalar(@{$res->{$UNSUPPORTED_FAIL}}) if (scalar(@{$res->{$UNSUPPORTED_FAIL}}));
715 printf " | %-40s | %7d |\n", $UNSUPPORTED_XPASS, scalar(@{$res->{$UNSUPPORTED_XPASS}}) if (scalar(@{$res->{$UNSUPPORTED_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200716 printf " | %-40s | %7d |\n", $UNSUPPORTED_UNRESOLVED, scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}) if (scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100717 printf " | %-40s | %7d |\n", $UNTESTED_FAIL, scalar(@{$res->{$UNTESTED_FAIL}}) if (scalar(@{$res->{$UNTESTED_FAIL}}));
718 printf " | %-40s | %7d |\n", $UNTESTED_XPASS, scalar(@{$res->{$UNTESTED_XPASS}}) if (scalar(@{$res->{$UNTESTED_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200719 printf " | %-40s | %7d |\n", $UNTESTED_UNRESOLVED, scalar(@{$res->{$UNTESTED_UNRESOLVED}}) if (scalar(@{$res->{$UNTESTED_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100720 printf " | %-40s | %7d |\n", $UNRESOLVED_FAIL, scalar(@{$res->{$UNRESOLVED_FAIL}}) if (scalar(@{$res->{$UNRESOLVED_FAIL}}));
721 printf " | %-40s | %7d |\n", $UNRESOLVED_XPASS, scalar(@{$res->{$UNRESOLVED_XPASS}}) if (scalar(@{$res->{$UNRESOLVED_XPASS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200722 printf " | %-40s | %7d |\n", $UNRESOLVED_APPEARS, scalar(@{$res->{$UNRESOLVED_APPEARS}}) if (scalar(@{$res->{$UNRESOLVED_APPEARS}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100723 printf " +------------------------------------------+---------+\n";
724 printf " | %-40s | %7d |\n", "TOTAL_REGRESSIONS", $rtotal;
725 printf " +------------------------------------------+---------+\n";
726 printf "\n";
727
728 if ($long)
729 {
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000730 print_tclist($res, $PASS_XPASS, @{$res->{$PASS_XPASS}});
731 print_tclist($res, $PASS_FAIL, @{$res->{$PASS_FAIL}});
732 print_tclist($res, $PASS_UNRESOLVED, @{$res->{$PASS_UNRESOLVED}});
733 print_tclist($res, $PASSED_NOW_TIMEOUTS, @{$res->{$PASSED_NOW_TIMEOUTS}});
734 print_tclist($res, $ERROR_APPEARS, @{$res->{$ERROR_APPEARS}});
735 print_tclist($res, $XPASS_FAIL, @{$res->{$XPASS_FAIL}});
736 print_tclist($res, $XPASS_APPEARS, @{$res->{$XPASS_APPEARS}});
737 print_tclist($res, $XPASS_UNRESOLVED, @{$res->{$XPASS_UNRESOLVED}});
738 print_tclist($res, $FAIL_APPEARS, @{$res->{$FAIL_APPEARS}});
739 print_tclist($res, $FAIL_UNRESOLVED, @{$res->{$FAIL_UNRESOLVED}});
740 print_tclist($res, $XFAIL_FAIL, @{$res->{$XFAIL_FAIL}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000741 print_tclist($res, $XFAIL_UNRESOLVED, @{$res->{$XFAIL_UNRESOLVED}});
742 print_tclist($res, $UNSUPPORTED_FAIL, @{$res->{$UNSUPPORTED_FAIL}});
743 print_tclist($res, $UNSUPPORTED_XPASS, @{$res->{$UNSUPPORTED_XPASS}});
744 print_tclist($res, $UNSUPPORTED_UNRESOLVED, @{$res->{$UNSUPPORTED_UNRESOLVED}});
745 print_tclist($res, $UNTESTED_FAIL, @{$res->{$UNTESTED_FAIL}});
746 print_tclist($res, $UNTESTED_XPASS, @{$res->{$UNTESTED_XPASS}});
747 print_tclist($res, $UNTESTED_UNRESOLVED, @{$res->{$UNTESTED_UNRESOLVED}});
748 print_tclist($res, $UNRESOLVED_FAIL, @{$res->{$UNRESOLVED_FAIL}});
749 print_tclist($res, $UNRESOLVED_XPASS, @{$res->{$UNRESOLVED_XPASS}});
750 print_tclist($res, $UNRESOLVED_APPEARS, @{$res->{$UNRESOLVED_APPEARS}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100751 }
752 printf "$col_reset\n";
753 }
754
Christophe Lyon924cce42018-11-30 15:38:19 +0000755 #### IMPROVEMENTS TO BE CHECKED ?
Christophe Lyonbff39612015-11-18 16:29:11 +0100756 if (not $quiet and not $short)
757 {
Christophe Lyon9dde3332016-06-28 23:00:00 +0200758 $total_better =
Christophe Lyon31279df2016-07-04 17:02:12 +0200759 scalar(@{$res->{$PASS_DISAPPEARS}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200760 scalar(@{$res->{$PASS_XFAIL}})+
761 scalar(@{$res->{$PASS_APPEARS}})+
762 scalar(@{$res->{$PASS_UNSUPPORTED}})+
763 scalar(@{$res->{$PASS_UNTESTED}})+
764 scalar(@{$res->{$XPASS_PASS}})+
765 scalar(@{$res->{$XPASS_XFAIL}})+
766 scalar(@{$res->{$XPASS_UNSUPPORTED}})+
767 scalar(@{$res->{$XPASS_UNTESTED}})+
768 scalar(@{$res->{$XPASS_DISAPPEARS}})+
Christophe Lyondded4d82016-06-28 18:12:38 +0200769 scalar(@{$res->{$FAIL_PASS}})+
770 scalar(@{$res->{$FAIL_XPASS}})+
Christophe Lyondded4d82016-06-28 18:12:38 +0200771 scalar(@{$res->{$FAIL_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200772 scalar(@{$res->{$FAIL_UNSUPPORTED}})+
773 scalar(@{$res->{$FAIL_UNTESTED}})+
774 scalar(@{$res->{$FAIL_DISAPPEARS}})+
Christophe Lyon3b675e82018-11-30 15:24:32 +0000775 scalar(@{$res->{$XFAIL_DISAPPEARS}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200776 scalar(@{$res->{$XFAIL_PASS}})+
777 scalar(@{$res->{$XFAIL_XPASS}})+
778 scalar(@{$res->{$XFAIL_UNSUPPORTED}})+
779 scalar(@{$res->{$XFAIL_UNTESTED}})+
780 scalar(@{$res->{$XFAIL_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100781 scalar(@{$res->{$UNSUPPORTED_PASS}})+
782 scalar(@{$res->{$UNSUPPORTED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200783 scalar(@{$res->{$UNSUPPORTED_UNTESTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100784 scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}})+
Christophe Lyondc66fc52016-04-05 17:38:07 +0200785 scalar(@{$res->{$UNSUPPORTED_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100786 scalar(@{$res->{$UNTESTED_PASS}})+
787 scalar(@{$res->{$UNTESTED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200788 scalar(@{$res->{$UNTESTED_UNSUPPORTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100789 scalar(@{$res->{$UNTESTED_DISAPPEARS}})+
Christophe Lyondc66fc52016-04-05 17:38:07 +0200790 scalar(@{$res->{$UNTESTED_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100791 scalar(@{$res->{$UNRESOLVED_PASS}})+
792 scalar(@{$res->{$UNRESOLVED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200793 scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}})+
794 scalar(@{$res->{$UNRESOLVED_UNTESTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100795 scalar(@{$res->{$UNRESOLVED_DISAPPEARS}})+
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200796 scalar(@{$res->{$ERROR_DISAPPEARS}})+
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100797 scalar(@{$res->{$UNHANDLED_CASES}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100798
Christophe Lyon924cce42018-11-30 15:38:19 +0000799 printf "$col_pink"."o IMPROVEMENTS TO BE CHECKED:\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100800 printf " +------------------------------------------+---------+\n";
Christophe Lyon31279df2016-07-04 17:02:12 +0200801 printf " | %-40s | %7d |\n", $PASS_DISAPPEARS, scalar(@{$res->{$PASS_DISAPPEARS}}) if (scalar(@{$res->{$PASS_DISAPPEARS}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200802 printf " | %-40s | %7d |\n", $PASS_XFAIL, scalar(@{$res->{$PASS_XFAIL}}) if (scalar(@{$res->{$PASS_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200803 printf " | %-40s | %7d |\n", $PASS_APPEARS, scalar(@{$res->{$PASS_APPEARS}}) if (scalar(@{$res->{$PASS_APPEARS}}));
804 printf " | %-40s | %7d |\n", $PASS_UNSUPPORTED, scalar(@{$res->{$PASS_UNSUPPORTED}}) if (scalar(@{$res->{$PASS_UNSUPPORTED}}));
805 printf " | %-40s | %7d |\n", $PASS_UNTESTED, scalar(@{$res->{$PASS_UNTESTED}}) if (scalar(@{$res->{$PASS_UNTESTED}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200806 printf " | %-40s | %7d |\n", $XPASS_PASS, scalar(@{$res->{$XPASS_PASS}}) if (scalar(@{$res->{$XPASS_PASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200807 printf " | %-40s | %7d |\n", $XPASS_XFAIL, scalar(@{$res->{$XPASS_XFAIL}}) if (scalar(@{$res->{$XPASS_XFAIL}}));
808 printf " | %-40s | %7d |\n", $XPASS_UNSUPPORTED, scalar(@{$res->{$XPASS_UNSUPPORTED}}) if (scalar(@{$res->{$XPASS_UNSUPPORTED}}));
809 printf " | %-40s | %7d |\n", $XPASS_UNTESTED, scalar(@{$res->{$XPASS_UNTESTED}}) if (scalar(@{$res->{$XPASS_UNTESTED}}));
810 printf " | %-40s | %7d |\n", $XPASS_DISAPPEARS, scalar(@{$res->{$XPASS_DISAPPEARS}}) if (scalar(@{$res->{$XPASS_DISAPPEARS}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200811 printf " | %-40s | %7d |\n", $FAIL_PASS, scalar(@{$res->{$FAIL_PASS}}) if (scalar(@{$res->{$FAIL_PASS}}));
812 printf " | %-40s | %7d |\n", $FAIL_XPASS, scalar(@{$res->{$FAIL_XPASS}}) if (scalar(@{$res->{$FAIL_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200813 printf " | %-40s | %7d |\n", $FAIL_XFAIL, scalar(@{$res->{$FAIL_XFAIL}}) if (scalar(@{$res->{$FAIL_XFAIL}}));
814 printf " | %-40s | %7d |\n", $FAIL_UNSUPPORTED, scalar(@{$res->{$FAIL_UNSUPPORTED}}) if (scalar(@{$res->{$FAIL_UNSUPPORTED}}));
815 printf " | %-40s | %7d |\n", $FAIL_UNTESTED, scalar(@{$res->{$FAIL_UNTESTED}}) if (scalar(@{$res->{$FAIL_UNTESTED}}));
816 printf " | %-40s | %7d |\n", $FAIL_DISAPPEARS, scalar(@{$res->{$FAIL_DISAPPEARS}}) if (scalar(@{$res->{$FAIL_DISAPPEARS}}));
Christophe Lyon3b675e82018-11-30 15:24:32 +0000817 printf " | %-40s | %7d |\n", $XFAIL_DISAPPEARS, scalar(@{$res->{$XFAIL_DISAPPEARS}}) if (scalar(@{$res->{$XFAIL_DISAPPEARS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200818 printf " | %-40s | %7d |\n", $XFAIL_PASS, scalar(@{$res->{$XFAIL_PASS}}) if (scalar(@{$res->{$XFAIL_PASS}}));
819 printf " | %-40s | %7d |\n", $XFAIL_XPASS, scalar(@{$res->{$XFAIL_XPASS}}) if (scalar(@{$res->{$XFAIL_XPASS}}));
820 printf " | %-40s | %7d |\n", $XFAIL_UNSUPPORTED, scalar(@{$res->{$XFAIL_UNSUPPORTED}}) if (scalar(@{$res->{$XFAIL_UNSUPPORTED}}));
821 printf " | %-40s | %7d |\n", $XFAIL_UNTESTED, scalar(@{$res->{$XFAIL_UNTESTED}}) if (scalar(@{$res->{$XFAIL_UNTESTED}}));
822 printf " | %-40s | %7d |\n", $XFAIL_APPEARS, scalar(@{$res->{$XFAIL_APPEARS}}) if (scalar(@{$res->{$XFAIL_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100823 printf " | %-40s | %7d |\n", $UNSUPPORTED_PASS, scalar(@{$res->{$UNSUPPORTED_PASS}}) if (scalar(@{$res->{$UNSUPPORTED_PASS}}));
824 printf " | %-40s | %7d |\n", $UNSUPPORTED_XFAIL, scalar(@{$res->{$UNSUPPORTED_XFAIL}}) if (scalar(@{$res->{$UNSUPPORTED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200825 printf " | %-40s | %7d |\n", $UNSUPPORTED_UNTESTED, scalar(@{$res->{$UNSUPPORTED_UNTESTED}}) if (scalar(@{$res->{$UNSUPPORTED_UNTESTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100826 printf " | %-40s | %7d |\n", $UNSUPPORTED_DISAPPEARS, scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200827 printf " | %-40s | %7d |\n", $UNSUPPORTED_APPEARS, scalar(@{$res->{$UNSUPPORTED_APPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100828 printf " | %-40s | %7d |\n", $UNTESTED_PASS, scalar(@{$res->{$UNTESTED_PASS}}) if (scalar(@{$res->{$UNTESTED_PASS}}));
829 printf " | %-40s | %7d |\n", $UNTESTED_XFAIL, scalar(@{$res->{$UNTESTED_XFAIL}}) if (scalar(@{$res->{$UNTESTED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200830 printf " | %-40s | %7d |\n", $UNTESTED_UNSUPPORTED, scalar(@{$res->{$UNTESTED_UNSUPPORTED}}) if (scalar(@{$res->{$UNTESTED_UNSUPPORTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100831 printf " | %-40s | %7d |\n", $UNTESTED_DISAPPEARS, scalar(@{$res->{$UNTESTED_DISAPPEARS}}) if (scalar(@{$res->{$UNTESTED_DISAPPEARS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200832 printf " | %-40s | %7d |\n", $UNTESTED_APPEARS, scalar(@{$res->{$UNTESTED_APPEARS}}) if (scalar(@{$res->{$UNTESTED_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100833 printf " | %-40s | %7d |\n", $UNRESOLVED_PASS, scalar(@{$res->{$UNRESOLVED_PASS}}) if (scalar(@{$res->{$UNRESOLVED_PASS}}));
834 printf " | %-40s | %7d |\n", $UNRESOLVED_XFAIL, scalar(@{$res->{$UNRESOLVED_XFAIL}}) if (scalar(@{$res->{$UNRESOLVED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200835 printf " | %-40s | %7d |\n", $UNRESOLVED_UNSUPPORTED, scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}) if (scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}));
836 printf " | %-40s | %7d |\n", $UNRESOLVED_UNTESTED, scalar(@{$res->{$UNRESOLVED_UNTESTED}}) if (scalar(@{$res->{$UNRESOLVED_UNTESTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100837 printf " | %-40s | %7d |\n", $UNRESOLVED_DISAPPEARS, scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}) if (scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}));
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200838 printf " | %-40s | %7d |\n", $ERROR_DISAPPEARS, scalar(@{$res->{$ERROR_DISAPPEARS}}) if (scalar(@{$res->{$ERROR_DISAPPEARS}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100839 printf " | %-40s | %7d |\n", $UNHANDLED_CASES, scalar(@{$res->{$UNHANDLED_CASES}}) if (scalar(@{$res->{$UNHANDLED_CASES}}));
840 printf " | %-40s | %7d |\n", $UNSTABLE_CASES, scalar(@{$res->{$UNSTABLE_CASES}}) if (scalar(@{$res->{$UNSTABLE_CASES}}));
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000841 printf " | %-40s | %7d |\n", $HWDEP_CASES, scalar(@{$res->{$HWDEP_CASES}}) if (scalar(@{$res->{$HWDEP_CASES}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100842 printf " +------------------------------------------+---------+\n";
Christophe Lyon924cce42018-11-30 15:38:19 +0000843 printf " | %-40s | %7d |\n", "TOTAL_IMPROVEMENTS_TO_BE_CHECKED", $total_better + scalar(@{$res->{$UNSTABLE_CASES}});;
Christophe Lyonbff39612015-11-18 16:29:11 +0100844 printf " +------------------------------------------+---------+\n";
845 printf "\n";
846
847 if ($long)
848 {
Christophe Lyon28a92782017-09-13 09:00:39 +0000849 print_tclist($res, $PASS_DISAPPEARS, @{$res->{$PASS_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000850 print_tclist($res, $PASS_XFAIL, @{$res->{$PASS_XFAIL}});
851 print_tclist($res, $PASS_APPEARS, @{$res->{$PASS_APPEARS}});
852 print_tclist($res, $PASS_UNSUPPORTED, @{$res->{$PASS_UNSUPPORTED}});
853 print_tclist($res, $PASS_UNTESTED, @{$res->{$PASS_UNTESTED}});
854 print_tclist($res, $XPASS_PASS, @{$res->{$XPASS_PASS}});
855 print_tclist($res, $XPASS_XFAIL, @{$res->{$XPASS_XFAIL}});
856 print_tclist($res, $XPASS_UNSUPPORTED, @{$res->{$XPASS_UNSUPPORTED}});
857 print_tclist($res, $XPASS_UNTESTED, @{$res->{$XPASS_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000858 print_tclist($res, $XPASS_DISAPPEARS, @{$res->{$XPASS_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000859 print_tclist($res, $FAIL_PASS, @{$res->{$FAIL_PASS}});
860 print_tclist($res, $FAIL_XPASS, @{$res->{$FAIL_XPASS}});
861 print_tclist($res, $FAIL_XFAIL, @{$res->{$FAIL_XFAIL}});
862 print_tclist($res, $FAIL_UNSUPPORTED, @{$res->{$FAIL_UNSUPPORTED}});
863 print_tclist($res, $FAIL_UNTESTED, @{$res->{$FAIL_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000864 print_tclist($res, $FAIL_DISAPPEARS, @{$res->{$FAIL_DISAPPEARS}});
Christophe Lyon3b675e82018-11-30 15:24:32 +0000865 print_tclist($res, $XFAIL_DISAPPEARS, @{$res->{$XFAIL_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000866 print_tclist($res, $XFAIL_PASS, @{$res->{$XFAIL_PASS}});
867 print_tclist($res, $XFAIL_XPASS, @{$res->{$XFAIL_XPASS}});
868 print_tclist($res, $XFAIL_UNSUPPORTED, @{$res->{$XFAIL_UNSUPPORTED}});
869 print_tclist($res, $XFAIL_UNTESTED, @{$res->{$XFAIL_UNTESTED}});
870 print_tclist($res, $XFAIL_APPEARS, @{$res->{$XFAIL_APPEARS}});
871 print_tclist($res, $UNSUPPORTED_PASS, @{$res->{$UNSUPPORTED_PASS}});
872 print_tclist($res, $UNSUPPORTED_XFAIL, @{$res->{$UNSUPPORTED_XFAIL}});
873 print_tclist($res, $UNSUPPORTED_UNTESTED, @{$res->{$UNSUPPORTED_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000874 print_tclist($res, $UNSUPPORTED_DISAPPEARS, @{$res->{$UNSUPPORTED_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000875 print_tclist($res, $UNSUPPORTED_APPEARS, @{$res->{$UNSUPPORTED_APPEARS}});
876 print_tclist($res, $UNTESTED_PASS, @{$res->{$UNTESTED_PASS}});
877 print_tclist($res, $UNTESTED_XFAIL, @{$res->{$UNTESTED_XFAIL}});
878 print_tclist($res, $UNTESTED_UNSUPPORTED, @{$res->{$UNTESTED_UNSUPPORTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000879 print_tclist($res, $UNTESTED_DISAPPEARS, @{$res->{$UNTESTED_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000880 print_tclist($res, $UNTESTED_APPEARS, @{$res->{$UNTESTED_APPEARS}});
881 print_tclist($res, $UNRESOLVED_PASS, @{$res->{$UNRESOLVED_PASS}});
882 print_tclist($res, $UNRESOLVED_XFAIL, @{$res->{$UNRESOLVED_XFAIL}});
883 print_tclist($res, $UNRESOLVED_UNSUPPORTED, @{$res->{$UNRESOLVED_UNSUPPORTED}});
884 print_tclist($res, $UNRESOLVED_UNTESTED, @{$res->{$UNRESOLVED_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000885 print_tclist($res, $UNRESOLVED_DISAPPEARS, @{$res->{$UNRESOLVED_DISAPPEARS}});
886 print_tclist($res, $ERROR_DISAPPEARS, @{$res->{$ERROR_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000887 print_tclist($res, $UNHANDLED_CASES, @{$res->{$UNHANDLED_CASES}});
888 print_tclist($res, $UNSTABLE_CASES, @{$res->{$UNSTABLE_CASES}});
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000889 print_tclist($res, $HWDEP_CASES, @{$res->{$HWDEP_CASES}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100890 }
891 printf "$col_reset\n";
892 }
893
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100894 $return_value = 1 if ($total_better);
Christophe Lyonbff39612015-11-18 16:29:11 +0100895
896 $return_value = 2 if ($rtotal);
897
Christophe Lyond618f662016-02-02 19:07:58 +0100898 # Error if there was no PASS (eg when sth went wrong and no .sum was generated)
899 $return_value = 2 if (($res->{PASS} + $res->{XFAIL}) == 0);
900
901 # Error if every test passed, or the ratio was too low. This
902 # generally means the simulator is not configured well.
903 $return_value = 2 if (($ref_ratio == 100) || ($ref_ratio < $ratio_thresh));
904 $return_value = 2 if (($res_ratio == 100) || ($res_ratio < $ratio_thresh));
Christophe Lyonbff39612015-11-18 16:29:11 +0100905
Christophe Lyonad8c7242016-02-03 13:04:28 +0100906 # Error if no execution test passed.
907 # It is possible that no execution test fails, though.
908 $return_value = 2 if (($ignore_exec == 0)
909 && (($ref->{EXEC}->{PASS} == 0)
910 || ($res->{EXEC}->{PASS} == 0)));
911
Christophe Lyonbff39612015-11-18 16:29:11 +0100912 return $return_value;
913}