blob: c200426a35d81b0e4751a1f026f67fa3bc2e4e84 [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 Lyon9a3ce972021-06-30 23:18:23 +0000262 $empty_result{NB}=0;
Christophe Lyonbff39612015-11-18 16:29:11 +0100263 return \%empty_result;
264}
265sub I_am_interactive {
266 return -t STDIN && -t STDOUT;
267}
268sub usage()
269{
270 print "Usage : $app <ref_file.sum> <result_file.sum>\n";
271 exit 1;
272}
273
274
275######################################################
276# PARSING
277sub read_sum($)
278{
279 my ($sum_file) = @_;
280 my $res = empty_result();
281 my %testcases;
282 my %unsupported;
283 $res->{testcases} = \%testcases;
284 my $pending_timeout=0;
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000285 my $current_exp="";
Christophe Lyonbff39612015-11-18 16:29:11 +0100286
Christophe Lyonad8c7242016-02-03 13:04:28 +0100287 $res->{EXEC}->{PASS} = 0;
288 $res->{EXEC}->{FAIL} = 0;
289
Christophe Lyonbff39612015-11-18 16:29:11 +0100290 open SUMFILE, $sum_file or die $!;
291 while (<SUMFILE>)
292 {
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000293 if (m/^(PASS|XPASS|FAIL|XFAIL|UNSUPPORTED|UNTESTED|UNRESOLVED|ERROR): *(.*)/)
Christophe Lyonbff39612015-11-18 16:29:11 +0100294 {
295 my ($diag,$tc) = ($1,$2);
296 my %tcresult;
297 $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./;
298 $testcases{$tc} = empty_result() if (not exists $testcases{$tc});
299 $testcases{$tc}->{$diag}++;
300 $testcases{$tc}->{HAS_TIMED_OUT} = $pending_timeout;
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000301 $testcases{$tc}->{EXP} = $current_exp;
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000302 $testcases{$tc}->{NB}++;
Christophe Lyonbff39612015-11-18 16:29:11 +0100303 $pending_timeout = 0;
304 $res->{$diag}++;
Christophe Lyonad8c7242016-02-03 13:04:28 +0100305 # Count execution tests, for a sanity check
306 if ($tc =~ /execution/)
307 {
308 $res->{EXEC}->{$diag}++;
309 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100310 }
311 elsif (m/WARNING: program timed out/)
312 {
313 $pending_timeout = 1;
314 }
315 elsif (m/^(# of expected passes|# of unexpected failures|# of expected failures|# of known failures|# of unsupported tests|# of untested testcases)\s+(.*)/)
316 {
317 $res->{"summary - "."$1"} = $2;
318 }
319 elsif (m/^\/.*\/([^\/]+)\s+version\s+(.*)/)
320 {
321 $res->{tool} = $1;
322 $res->{version} = $2;
323 $res->{version} =~ s/ [-(].*//;
324 }
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000325 elsif (m/^Running target .*/)
326 {
327 }
328 elsif (m/^Running (.*) \.\.\.*/)
329 {
330 $current_exp=$1;
331 $current_exp =~ s|.*/testsuite/||;
332 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100333 }
334 close SUMFILE;
335 return $res;
336}
337
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000338# Parse list of unstable/hw-dependent tests
Christophe Lyonbff39612015-11-18 16:29:11 +0100339sub read_unstable($)
340{
341 my ($unstable_file) = @_;
342 my @unstable_tests = ();
343
344 open UNSTABLEFILE, $unstable_file or die $!;
345 while (<UNSTABLEFILE>)
346 {
347 # Skip lines starting with '#', or with spaces only
348 if ((/^#/) || (/^[ ]*$/))
349 {
350 }
351 else
352 {
353 chomp;
354
355 my $test = $_;
356
357 # Check if line is of type: target:testname
Christophe Lyon5e7241c2015-12-04 12:57:27 +0100358 if (/^(.*?):/)
Christophe Lyonbff39612015-11-18 16:29:11 +0100359 {
360 foreach my $unstable_marker (@unstable_markers)
361 {
362 if ($unstable_marker eq $1) {
363 # If target matches the one supplied as script
364 # argument, add the testname to the list
Christophe Lyon5e7241c2015-12-04 12:57:27 +0100365 $test =~ s/.*?://;
Christophe Lyonbff39612015-11-18 16:29:11 +0100366 push @unstable_tests, $test;
367 }
368 }
369 } else {
370 push @unstable_tests, $test;
371 }
372 }
373 }
374 close UNSTABLEFILE;
375 return @unstable_tests;
376}
377
378######################################################
379# DIFFING
380sub handle_pass_fail($$$$)
381{
382 my ($ref, $res, $diag_diag, $tc) = @_;
383 if ($res->{testcases}->{$tc}->{HAS_TIMED_OUT})
384 {
385 push @{$res->{$PASSED_NOW_TIMEOUTS}}, $tc;
386 }
387 else
388 {
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000389 # This transition is flagged as hw-dependent if:
390 # - the name is in the list
391 # - the transition should not be reported (but be flagged as hw-dependent instead)
392 # - --no-hwdep was not provided
393 if ((grep { (index $tc,$_)!=-1} @hwdep_list)
394 && ($diag_diag->{report_hwdep} eq "false")
395 && ($no_hwdep == 0)) {
396 push @{$res->{$HWDEP_CASES}}, $tc;
397 } else {
398 push @{$res->{$PASS_FAIL}}, $tc;
399 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100400 }
401}
402
403sub compare_results($$)
404{
405 my ($ref, $res) = @_;
406
Christophe Lyondded4d82016-06-28 18:12:38 +0200407 @{$res->{$PASS_PASS}} = ();
Christophe Lyondded4d82016-06-28 18:12:38 +0200408 @{$res->{$PASS_XPASS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200409 @{$res->{$PASS_FAIL}} = ();
410 @{$res->{$PASS_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200411 @{$res->{$PASS_UNSUPPORTED}} = ();
412 @{$res->{$PASS_UNTESTED}} = ();
413 @{$res->{$PASS_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200414 @{$res->{$PASS_DISAPPEARS}} = ();
415 @{$res->{$PASS_APPEARS}} = ();
416 @{$res->{$PASSED_NOW_TIMEOUTS}} = ();
417
Christophe Lyondded4d82016-06-28 18:12:38 +0200418 @{$res->{$XPASS_PASS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200419 @{$res->{$XPASS_XPASS}} = ();
420 @{$res->{$XPASS_FAIL}} = ();
421 @{$res->{$XPASS_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200422 @{$res->{$XPASS_UNSUPPORTED}} = ();
423 @{$res->{$XPASS_UNTESTED}} = ();
424 @{$res->{$XPASS_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200425 @{$res->{$XPASS_DISAPPEARS}} = ();
426 @{$res->{$XPASS_APPEARS}} = ();
427
428 @{$res->{$FAIL_PASS}} = ();
429 @{$res->{$FAIL_XPASS}} = ();
430 @{$res->{$FAIL_FAIL}} = ();
431 @{$res->{$FAIL_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200432 @{$res->{$FAIL_UNSUPPORTED}} = ();
433 @{$res->{$FAIL_UNTESTED}} = ();
434 @{$res->{$FAIL_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200435 @{$res->{$FAIL_DISAPPEARS}} = ();
436 @{$res->{$FAIL_APPEARS}} = ();
437
Christophe Lyondded4d82016-06-28 18:12:38 +0200438 @{$res->{$XFAIL_PASS}} = ();
439 @{$res->{$XFAIL_XPASS}} = ();
440 @{$res->{$XFAIL_FAIL}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200441 @{$res->{$XFAIL_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200442 @{$res->{$XFAIL_UNSUPPORTED}} = ();
443 @{$res->{$XFAIL_UNTESTED}} = ();
444 @{$res->{$XFAIL_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200445 @{$res->{$XFAIL_DISAPPEARS}} = ();
446 @{$res->{$XFAIL_APPEARS}} = ();
447
Christophe Lyona140aa82015-12-17 22:53:03 +0100448 @{$res->{$UNSUPPORTED_PASS}} = ();
449 @{$res->{$UNSUPPORTED_XPASS}} = ();
450 @{$res->{$UNSUPPORTED_FAIL}} = ();
451 @{$res->{$UNSUPPORTED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200452 @{$res->{$UNSUPPORTED_UNSUPPORTED}} = ();
453 @{$res->{$UNSUPPORTED_UNTESTED}} = ();
454 @{$res->{$UNSUPPORTED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100455 @{$res->{$UNSUPPORTED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200456 @{$res->{$UNSUPPORTED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200457
Christophe Lyona140aa82015-12-17 22:53:03 +0100458 @{$res->{$UNTESTED_PASS}} = ();
459 @{$res->{$UNTESTED_XPASS}} = ();
460 @{$res->{$UNTESTED_FAIL}} = ();
461 @{$res->{$UNTESTED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200462 @{$res->{$UNTESTED_UNSUPPORTED}} = ();
463 @{$res->{$UNTESTED_UNTESTED}} = ();
464 @{$res->{$UNTESTED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100465 @{$res->{$UNTESTED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200466 @{$res->{$UNTESTED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200467
Christophe Lyona140aa82015-12-17 22:53:03 +0100468 @{$res->{$UNRESOLVED_PASS}} = ();
469 @{$res->{$UNRESOLVED_XPASS}} = ();
470 @{$res->{$UNRESOLVED_FAIL}} = ();
471 @{$res->{$UNRESOLVED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200472 @{$res->{$UNRESOLVED_UNSUPPORTED}} = ();
473 @{$res->{$UNRESOLVED_UNTESTED}} = ();
474 @{$res->{$UNRESOLVED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100475 @{$res->{$UNRESOLVED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200476 @{$res->{$UNRESOLVED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200477
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200478 @{$res->{$ERROR_DISAPPEARS}} = ();
479 @{$res->{$ERROR_APPEARS}} = ();
480
Christophe Lyonbff39612015-11-18 16:29:11 +0100481 @{$res->{$UNHANDLED_CASES}} = ();
482 @{$res->{$UNSTABLE_CASES}} = ();
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000483 @{$res->{$HWDEP_CASES}} = ();
Christophe Lyonbff39612015-11-18 16:29:11 +0100484
485 #### MERGE REF AND RES
486 foreach my $key (sort (keys %{$res->{testcases}}))
487 {
488 if (not exists $ref->{testcases}->{$key}) {
489 $ref->{testcases}->{$key} = empty_result();
490 $ref->{testcases}->{$key}->{NO_EXIST} = 1;
Christophe Lyon28a92782017-09-13 09:00:39 +0000491 $ref->{testcases}->{$key}->{EXP} = $res->{testcases}->{$key}->{EXP};
Christophe Lyonbff39612015-11-18 16:29:11 +0100492 }
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000493
494 # Consistency check, useful in case of duplicate test names
495 if ($ref->{testcases}->{$key}->{NB} != $res->{testcases}->{$key}->{NB}) {
496 print "Number of occurrences mismatch $key (ref $ref->{testcases}->{$key}->{NB} vs $res->{testcases}->{$key}->{NB})\n" if ($debug);
497 if ($ref->{testcases}->{$key}->{NB} > $res->{testcases}->{$key}->{NB}) {
498 $res->{testcases}->{$key}->{NO_EXIST} = 1;
499 } elsif ($ref->{testcases}->{$key}->{NB} < $res->{testcases}->{$key}->{NB}) {
500 $ref->{testcases}->{$key}->{NO_EXIST} = 1;
501 }
502 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100503 }
504 foreach my $key (keys %{$ref->{testcases}})
505 {
506 if (not exists $res->{testcases}->{$key})
507 {
508 $res->{testcases}->{$key} = empty_result();
509 $res->{testcases}->{$key}->{NO_EXIST} = 1;
Christophe Lyon28a92782017-09-13 09:00:39 +0000510 $res->{testcases}->{$key}->{EXP} = $ref->{testcases}->{$key}->{EXP};
Christophe Lyonbff39612015-11-18 16:29:11 +0100511 }
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000512
513 # No need for similar consistency check: since we are
514 # checking for tests whose number of occurrences are
515 # different, they are present in both ref and res, so
516 # no need to check again here.
Christophe Lyonbff39612015-11-18 16:29:11 +0100517 }
518
519 #### ACTIONS FOR EACH CASES
520 my %unstable_found;
521
522 foreach my $key (sort (keys %{$ref->{testcases}}))
523 {
524 foreach my $diag_diag (@handler_list)
525 {
526 if ($ref->{testcases}->{$key}->{$diag_diag->{was}} != $res->{testcases}->{$key}->{$diag_diag->{was}}
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000527 and $ref->{testcases}->{$key}->{$diag_diag->{was}}
Christophe Lyonbff39612015-11-18 16:29:11 +0100528 and $res->{testcases}->{$key}->{$diag_diag->{is}})
529 {
Christophe Lyon1ed93102021-06-30 23:04:43 +0000530 print "$key ref $diag_diag->{was}:$ref->{testcases}->{$key}->{$diag_diag->{was}}, res $diag_diag->{was}:$res->{testcases}->{$key}->{$diag_diag->{was}}, res $diag_diag->{is}:$res->{testcases}->{$key}->{$diag_diag->{is}} \n" if ($debug);
Christophe Lyon28a92782017-09-13 09:00:39 +0000531 # If testcase is listed as 'unstable' mark it as such
532 # and skip other processing to avoid listing it twice.
Christophe Lyonbff39612015-11-18 16:29:11 +0100533 {
534 if (grep { (index $key,$_)!=-1} @unstablelist)
535 {
536 print "[unstable] $key\n" if ($debug);
537 $unstable_found{$key}=1;
538 }
539 else {
540 print "[$diag_diag->{was} => $diag_diag->{is}] $key\n" if ($debug);
541 if ($diag_diag->{handler})
542 {
543 $diag_diag->{handler} ($ref, $res, $diag_diag, $key);
544 }
545 else
546 {
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000547 # This transition is flagged as hw-dependent if:
548 # - the name is in the list
549 # - the transition should not be reported (but be flagged as hw-dependent instead)
550 # - --no-hwdep was not provided
551 if ((grep { (index $key,$_)!=-1} @hwdep_list)
552 && ($diag_diag->{report_hwdep} eq "false")
553 && ($no_hwdep == 0)) {
554 push @{$res->{$HWDEP_CASES}}, $key;
555 } else {
556 push @{$res->{$diag_diag->{cat}}}, $key;
557 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100558 }
559 }
560 }
561 }
562 }
563 }
564 push @{$res->{$UNSTABLE_CASES}}, (sort (keys (%unstable_found))) if ($nounstable == 0);
565
566}
567
568######################################################
569# PRINTING
570sub print_tclist($@)
571{
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000572 # The 1st parameter is used to find the name of the .exp file
Christophe Lyon28a92782017-09-13 09:00:39 +0000573 # associated with the testcase.
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000574 my ($this_res, $cat, @tclist) = @_;
575 my $this_exp = "";
576 if (scalar(@tclist))
577 {
578 print " - ".$cat.":\n\n";
579 foreach my $case (@tclist)
580 {
581 if ($this_exp ne $this_res->{testcases}->{$case}->{EXP}) {
582 $this_exp = $this_res->{testcases}->{$case}->{EXP};
583 print " Executed from: $this_exp\n";
584 }
585 print " $case\n";
586 }
587 print "\n\n";
588 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100589}
590
591sub print_compare_results_summary($$)
592{
593 my ($ref, $res) = @_;
594 my $return_value=0;
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100595 my $total_better = 0;
Christophe Lyonbff39612015-11-18 16:29:11 +0100596 my $rtotal = 0;
597 my $quiet_reg = $quiet;
Christophe Lyond618f662016-02-02 19:07:58 +0100598 my $ref_ratio = 0;
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200599 my $ref_total = 0;
Christophe Lyond618f662016-02-02 19:07:58 +0100600 my $res_ratio = 0;
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200601 my $res_total = 0;
Christophe Lyonad8c7242016-02-03 13:04:28 +0100602 my $ignore_exec = 0;
603 my $ref_has_exec_tests = 0;
604 my $res_has_exec_tests = 0;
Christophe Lyond618f662016-02-02 19:07:58 +0100605
606 # Compute the pass ratio as a sanity check
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200607 $ref_total = $ref->{PASS} +
608 $ref->{XFAIL} +
609 $ref->{XPASS} +
610 $ref->{FAIL} +
611 $ref->{UNRESOLVED} +
612 $ref->{UNSUPPORTED} +
613 $ref->{UNTESTED};
614
615 # It is possible that no test is executed at all (for instance if
616 # RUNTESTFLAGS was too restrictive). Avoid division by 0.
617 if ($ref_total > 0) {
618 $ref_ratio = ($ref->{PASS} + $ref->{XFAIL}) /
619 $ref_total;
620 }
621
622 $res_total = $res->{PASS} +
623 $res->{XFAIL} +
624 $res->{XPASS} +
625 $res->{FAIL} +
626 $res->{UNRESOLVED} +
627 $res->{UNSUPPORTED} +
628 $res->{UNTESTED};
629
630 if ($res_total > 0) {
631 $res_ratio = ($res->{PASS} + $res->{XFAIL}) /
632 $res_total;
633 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100634
635 if (not $quiet)
636 {
637 printf "Comparing:\n";
638 printf "REFERENCE:$ref_file_name\n";
639 printf "CURRENT: $res_file_name\n\n";
640 }
641
642 #### TESTS STATUS
643 if (not $quiet and not $short)
644 {
645 printf " ` +---------+---------+\n";
Christophe Lyona140aa82015-12-17 22:53:03 +0100646 printf "o RUN STATUS: | REF | RES |\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100647 printf " +------------------------------------------+---------+---------+\n";
Christophe Lyona140aa82015-12-17 22:53:03 +0100648 printf " | %-40s | %7d | %7d |\n", "Passes [PASS]", $ref->{PASS}, $res->{PASS};
Christophe Lyonbff39612015-11-18 16:29:11 +0100649 printf " | %-40s | %7d | %7d |\n", "Unexpected fails [FAIL]", $ref->{FAIL}, $res->{FAIL};
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200650 printf " | %-40s | %7d | %7d |\n", "Errors [ERROR]", $ref->{ERROR}, $res->{ERROR};
Christophe Lyona140aa82015-12-17 22:53:03 +0100651 printf " | %-40s | %7d | %7d |\n", "Unexpected passes [XPASS]", $ref->{XPASS}, $res->{XPASS};
Christophe Lyonbff39612015-11-18 16:29:11 +0100652 printf " | %-40s | %7d | %7d |\n", "Expected fails [XFAIL]", $ref->{XFAIL}, $res->{XFAIL};
653 printf " | %-40s | %7d | %7d |\n", "Unresolved [UNRESOLVED]", $ref->{UNRESOLVED}, $res->{UNRESOLVED};
Christophe Lyona140aa82015-12-17 22:53:03 +0100654 printf " | %-40s | %7d | %7d |\n", "Unsupported [UNSUPPORTED]", $ref->{UNSUPPORTED}, $res->{UNSUPPORTED};
655 printf " | %-40s | %7d | %7d |\n", "Untested [UNTESTED]", $ref->{UNTESTED}, $res->{UNTESTED};
Christophe Lyonbff39612015-11-18 16:29:11 +0100656 printf " +------------------------------------------+---------+---------+\n";
657 printf "\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100658
Christophe Lyon3d195c22016-04-06 16:00:25 +0200659 printf " REF PASS ratio: %f\n", $ref_ratio;
660 printf " RES PASS ratio: %f\n", $res_ratio;
Christophe Lyond618f662016-02-02 19:07:58 +0100661 if ($ref_ratio < $ratio_thresh)
662 {
Christophe Lyon1176f962016-03-03 18:01:10 +0100663 printf " ***** ERROR: REF PASS ratio is abnormally low *****\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100664 }
665 if ($res_ratio < $ratio_thresh)
666 {
Christophe Lyon1176f962016-03-03 18:01:10 +0100667 printf " ***** ERROR: RES PASS ratio is abnormally low *****\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100668 }
669
Christophe Lyonad8c7242016-02-03 13:04:28 +0100670 # If both PASS and FAIL EXEC tests are zero, assume there is no
671 # execution test for this tool, and do not warn.
672 $ref_has_exec_tests = ($ref->{EXEC}->{PASS} + $ref->{EXEC}->{FAIL}) != 0;
673 if ($ref_has_exec_tests)
674 {
675 printf " ***** ERROR: No REF execution test PASSed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{PASS} == 0);
676 printf " ***** WARNING: No REF execution test FAILed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{FAIL} == 0);
677 }
678
679 $res_has_exec_tests = ($res->{EXEC}->{PASS} + $res->{EXEC}->{FAIL}) != 0;
680 if ($res_has_exec_tests)
681 {
682 printf " ***** ERROR: No RES execution test PASSed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{PASS} == 0);
683 printf " ***** WARNING: No RES execution test FAILed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{FAIL} == 0);
684 }
685
686 # Ignore number of execution tests when computing the return
687 # value, if both REF and RES have no execution test.
688 $ignore_exec = !$ref_has_exec_tests && !$res_has_exec_tests;
Christophe Lyonbff39612015-11-18 16:29:11 +0100689 }
690
691 #### REGRESSIONS ?
Christophe Lyon9dde3332016-06-28 23:00:00 +0200692 $rtotal = scalar(@{$res->{$PASS_XPASS}})
693 +scalar(@{$res->{$PASS_FAIL}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200694 +scalar(@{$res->{$PASS_UNRESOLVED}})
695 +scalar(@{$res->{$PASSED_NOW_TIMEOUTS}})
Christophe Lyon30037832018-11-30 15:33:20 +0000696 +scalar(@{$res->{$ERROR_APPEARS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200697 +scalar(@{$res->{$XPASS_FAIL}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100698 +scalar(@{$res->{$XPASS_APPEARS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200699 +scalar(@{$res->{$XPASS_UNRESOLVED}})
700 +scalar(@{$res->{$FAIL_APPEARS}})
701 +scalar(@{$res->{$FAIL_UNRESOLVED}})
Christophe Lyondded4d82016-06-28 18:12:38 +0200702 +scalar(@{$res->{$XFAIL_FAIL}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200703 +scalar(@{$res->{$XFAIL_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100704 +scalar(@{$res->{$UNSUPPORTED_FAIL}})
705 +scalar(@{$res->{$UNSUPPORTED_XPASS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200706 +scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100707 +scalar(@{$res->{$UNTESTED_FAIL}})
708 +scalar(@{$res->{$UNTESTED_XPASS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200709 +scalar(@{$res->{$UNTESTED_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100710 +scalar(@{$res->{$UNRESOLVED_FAIL}})
711 +scalar(@{$res->{$UNRESOLVED_XPASS}})
Christophe Lyon30037832018-11-30 15:33:20 +0000712 +scalar(@{$res->{$UNRESOLVED_APPEARS}});
Christophe Lyona140aa82015-12-17 22:53:03 +0100713
714 $quiet_reg=1 if ($short and not $rtotal);
Christophe Lyonbff39612015-11-18 16:29:11 +0100715
716 if (not $quiet_reg)
717 {
Christophe Lyona140aa82015-12-17 22:53:03 +0100718 printf "\n$col_red"."o REGRESSIONS:\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100719 printf " +------------------------------------------+---------+\n";
Christophe Lyondded4d82016-06-28 18:12:38 +0200720 printf " | %-40s | %7d |\n", $PASS_XPASS, scalar(@{$res->{$PASS_XPASS}}) if (scalar(@{$res->{$PASS_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200721 printf " | %-40s | %7d |\n", $PASS_FAIL, scalar(@{$res->{$PASS_FAIL}}) if (scalar(@{$res->{$PASS_FAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200722 printf " | %-40s | %7d |\n", $PASS_UNRESOLVED, scalar(@{$res->{$PASS_UNRESOLVED}}) if (scalar(@{$res->{$PASS_UNRESOLVED}}));
723 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 +0200724 printf " | %-40s | %7d |\n", $ERROR_APPEARS, scalar(@{$res->{$ERROR_APPEARS}}) if (scalar(@{$res->{$ERROR_APPEARS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200725 printf " | %-40s | %7d |\n", $XPASS_FAIL, scalar(@{$res->{$XPASS_FAIL}}) if (scalar(@{$res->{$XPASS_FAIL}}));
726 printf " | %-40s | %7d |\n", $XPASS_APPEARS, scalar(@{$res->{$XPASS_APPEARS}}) if (scalar(@{$res->{$XPASS_APPEARS}}));
727 printf " | %-40s | %7d |\n", $XPASS_UNRESOLVED, scalar(@{$res->{$XPASS_UNRESOLVED}}) if (scalar(@{$res->{$XPASS_UNRESOLVED}}));
728 printf " | %-40s | %7d |\n", $FAIL_APPEARS, scalar(@{$res->{$FAIL_APPEARS}}) if (scalar(@{$res->{$FAIL_APPEARS}}));
729 printf " | %-40s | %7d |\n", $FAIL_UNRESOLVED, scalar(@{$res->{$FAIL_UNRESOLVED}}) if (scalar(@{$res->{$FAIL_UNRESOLVED}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200730 printf " | %-40s | %7d |\n", $XFAIL_FAIL, scalar(@{$res->{$XFAIL_FAIL}}) if (scalar(@{$res->{$XFAIL_FAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200731 printf " | %-40s | %7d |\n", $XFAIL_UNRESOLVED, scalar(@{$res->{$XFAIL_UNRESOLVED}}) if (scalar(@{$res->{$XFAIL_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100732 printf " | %-40s | %7d |\n", $UNSUPPORTED_FAIL, scalar(@{$res->{$UNSUPPORTED_FAIL}}) if (scalar(@{$res->{$UNSUPPORTED_FAIL}}));
733 printf " | %-40s | %7d |\n", $UNSUPPORTED_XPASS, scalar(@{$res->{$UNSUPPORTED_XPASS}}) if (scalar(@{$res->{$UNSUPPORTED_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200734 printf " | %-40s | %7d |\n", $UNSUPPORTED_UNRESOLVED, scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}) if (scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100735 printf " | %-40s | %7d |\n", $UNTESTED_FAIL, scalar(@{$res->{$UNTESTED_FAIL}}) if (scalar(@{$res->{$UNTESTED_FAIL}}));
736 printf " | %-40s | %7d |\n", $UNTESTED_XPASS, scalar(@{$res->{$UNTESTED_XPASS}}) if (scalar(@{$res->{$UNTESTED_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200737 printf " | %-40s | %7d |\n", $UNTESTED_UNRESOLVED, scalar(@{$res->{$UNTESTED_UNRESOLVED}}) if (scalar(@{$res->{$UNTESTED_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100738 printf " | %-40s | %7d |\n", $UNRESOLVED_FAIL, scalar(@{$res->{$UNRESOLVED_FAIL}}) if (scalar(@{$res->{$UNRESOLVED_FAIL}}));
739 printf " | %-40s | %7d |\n", $UNRESOLVED_XPASS, scalar(@{$res->{$UNRESOLVED_XPASS}}) if (scalar(@{$res->{$UNRESOLVED_XPASS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200740 printf " | %-40s | %7d |\n", $UNRESOLVED_APPEARS, scalar(@{$res->{$UNRESOLVED_APPEARS}}) if (scalar(@{$res->{$UNRESOLVED_APPEARS}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100741 printf " +------------------------------------------+---------+\n";
742 printf " | %-40s | %7d |\n", "TOTAL_REGRESSIONS", $rtotal;
743 printf " +------------------------------------------+---------+\n";
744 printf "\n";
745
746 if ($long)
747 {
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000748 print_tclist($res, $PASS_XPASS, @{$res->{$PASS_XPASS}});
749 print_tclist($res, $PASS_FAIL, @{$res->{$PASS_FAIL}});
750 print_tclist($res, $PASS_UNRESOLVED, @{$res->{$PASS_UNRESOLVED}});
751 print_tclist($res, $PASSED_NOW_TIMEOUTS, @{$res->{$PASSED_NOW_TIMEOUTS}});
752 print_tclist($res, $ERROR_APPEARS, @{$res->{$ERROR_APPEARS}});
753 print_tclist($res, $XPASS_FAIL, @{$res->{$XPASS_FAIL}});
754 print_tclist($res, $XPASS_APPEARS, @{$res->{$XPASS_APPEARS}});
755 print_tclist($res, $XPASS_UNRESOLVED, @{$res->{$XPASS_UNRESOLVED}});
756 print_tclist($res, $FAIL_APPEARS, @{$res->{$FAIL_APPEARS}});
757 print_tclist($res, $FAIL_UNRESOLVED, @{$res->{$FAIL_UNRESOLVED}});
758 print_tclist($res, $XFAIL_FAIL, @{$res->{$XFAIL_FAIL}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000759 print_tclist($res, $XFAIL_UNRESOLVED, @{$res->{$XFAIL_UNRESOLVED}});
760 print_tclist($res, $UNSUPPORTED_FAIL, @{$res->{$UNSUPPORTED_FAIL}});
761 print_tclist($res, $UNSUPPORTED_XPASS, @{$res->{$UNSUPPORTED_XPASS}});
762 print_tclist($res, $UNSUPPORTED_UNRESOLVED, @{$res->{$UNSUPPORTED_UNRESOLVED}});
763 print_tclist($res, $UNTESTED_FAIL, @{$res->{$UNTESTED_FAIL}});
764 print_tclist($res, $UNTESTED_XPASS, @{$res->{$UNTESTED_XPASS}});
765 print_tclist($res, $UNTESTED_UNRESOLVED, @{$res->{$UNTESTED_UNRESOLVED}});
766 print_tclist($res, $UNRESOLVED_FAIL, @{$res->{$UNRESOLVED_FAIL}});
767 print_tclist($res, $UNRESOLVED_XPASS, @{$res->{$UNRESOLVED_XPASS}});
768 print_tclist($res, $UNRESOLVED_APPEARS, @{$res->{$UNRESOLVED_APPEARS}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100769 }
770 printf "$col_reset\n";
771 }
772
Christophe Lyon924cce42018-11-30 15:38:19 +0000773 #### IMPROVEMENTS TO BE CHECKED ?
Christophe Lyonbff39612015-11-18 16:29:11 +0100774 if (not $quiet and not $short)
775 {
Christophe Lyon9dde3332016-06-28 23:00:00 +0200776 $total_better =
Christophe Lyon31279df2016-07-04 17:02:12 +0200777 scalar(@{$res->{$PASS_DISAPPEARS}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200778 scalar(@{$res->{$PASS_XFAIL}})+
779 scalar(@{$res->{$PASS_APPEARS}})+
780 scalar(@{$res->{$PASS_UNSUPPORTED}})+
781 scalar(@{$res->{$PASS_UNTESTED}})+
782 scalar(@{$res->{$XPASS_PASS}})+
783 scalar(@{$res->{$XPASS_XFAIL}})+
784 scalar(@{$res->{$XPASS_UNSUPPORTED}})+
785 scalar(@{$res->{$XPASS_UNTESTED}})+
786 scalar(@{$res->{$XPASS_DISAPPEARS}})+
Christophe Lyondded4d82016-06-28 18:12:38 +0200787 scalar(@{$res->{$FAIL_PASS}})+
788 scalar(@{$res->{$FAIL_XPASS}})+
Christophe Lyondded4d82016-06-28 18:12:38 +0200789 scalar(@{$res->{$FAIL_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200790 scalar(@{$res->{$FAIL_UNSUPPORTED}})+
791 scalar(@{$res->{$FAIL_UNTESTED}})+
792 scalar(@{$res->{$FAIL_DISAPPEARS}})+
Christophe Lyon3b675e82018-11-30 15:24:32 +0000793 scalar(@{$res->{$XFAIL_DISAPPEARS}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200794 scalar(@{$res->{$XFAIL_PASS}})+
795 scalar(@{$res->{$XFAIL_XPASS}})+
796 scalar(@{$res->{$XFAIL_UNSUPPORTED}})+
797 scalar(@{$res->{$XFAIL_UNTESTED}})+
798 scalar(@{$res->{$XFAIL_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100799 scalar(@{$res->{$UNSUPPORTED_PASS}})+
800 scalar(@{$res->{$UNSUPPORTED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200801 scalar(@{$res->{$UNSUPPORTED_UNTESTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100802 scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}})+
Christophe Lyondc66fc52016-04-05 17:38:07 +0200803 scalar(@{$res->{$UNSUPPORTED_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100804 scalar(@{$res->{$UNTESTED_PASS}})+
805 scalar(@{$res->{$UNTESTED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200806 scalar(@{$res->{$UNTESTED_UNSUPPORTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100807 scalar(@{$res->{$UNTESTED_DISAPPEARS}})+
Christophe Lyondc66fc52016-04-05 17:38:07 +0200808 scalar(@{$res->{$UNTESTED_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100809 scalar(@{$res->{$UNRESOLVED_PASS}})+
810 scalar(@{$res->{$UNRESOLVED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200811 scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}})+
812 scalar(@{$res->{$UNRESOLVED_UNTESTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100813 scalar(@{$res->{$UNRESOLVED_DISAPPEARS}})+
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200814 scalar(@{$res->{$ERROR_DISAPPEARS}})+
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100815 scalar(@{$res->{$UNHANDLED_CASES}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100816
Christophe Lyon924cce42018-11-30 15:38:19 +0000817 printf "$col_pink"."o IMPROVEMENTS TO BE CHECKED:\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100818 printf " +------------------------------------------+---------+\n";
Christophe Lyon31279df2016-07-04 17:02:12 +0200819 printf " | %-40s | %7d |\n", $PASS_DISAPPEARS, scalar(@{$res->{$PASS_DISAPPEARS}}) if (scalar(@{$res->{$PASS_DISAPPEARS}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200820 printf " | %-40s | %7d |\n", $PASS_XFAIL, scalar(@{$res->{$PASS_XFAIL}}) if (scalar(@{$res->{$PASS_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200821 printf " | %-40s | %7d |\n", $PASS_APPEARS, scalar(@{$res->{$PASS_APPEARS}}) if (scalar(@{$res->{$PASS_APPEARS}}));
822 printf " | %-40s | %7d |\n", $PASS_UNSUPPORTED, scalar(@{$res->{$PASS_UNSUPPORTED}}) if (scalar(@{$res->{$PASS_UNSUPPORTED}}));
823 printf " | %-40s | %7d |\n", $PASS_UNTESTED, scalar(@{$res->{$PASS_UNTESTED}}) if (scalar(@{$res->{$PASS_UNTESTED}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200824 printf " | %-40s | %7d |\n", $XPASS_PASS, scalar(@{$res->{$XPASS_PASS}}) if (scalar(@{$res->{$XPASS_PASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200825 printf " | %-40s | %7d |\n", $XPASS_XFAIL, scalar(@{$res->{$XPASS_XFAIL}}) if (scalar(@{$res->{$XPASS_XFAIL}}));
826 printf " | %-40s | %7d |\n", $XPASS_UNSUPPORTED, scalar(@{$res->{$XPASS_UNSUPPORTED}}) if (scalar(@{$res->{$XPASS_UNSUPPORTED}}));
827 printf " | %-40s | %7d |\n", $XPASS_UNTESTED, scalar(@{$res->{$XPASS_UNTESTED}}) if (scalar(@{$res->{$XPASS_UNTESTED}}));
828 printf " | %-40s | %7d |\n", $XPASS_DISAPPEARS, scalar(@{$res->{$XPASS_DISAPPEARS}}) if (scalar(@{$res->{$XPASS_DISAPPEARS}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200829 printf " | %-40s | %7d |\n", $FAIL_PASS, scalar(@{$res->{$FAIL_PASS}}) if (scalar(@{$res->{$FAIL_PASS}}));
830 printf " | %-40s | %7d |\n", $FAIL_XPASS, scalar(@{$res->{$FAIL_XPASS}}) if (scalar(@{$res->{$FAIL_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200831 printf " | %-40s | %7d |\n", $FAIL_XFAIL, scalar(@{$res->{$FAIL_XFAIL}}) if (scalar(@{$res->{$FAIL_XFAIL}}));
832 printf " | %-40s | %7d |\n", $FAIL_UNSUPPORTED, scalar(@{$res->{$FAIL_UNSUPPORTED}}) if (scalar(@{$res->{$FAIL_UNSUPPORTED}}));
833 printf " | %-40s | %7d |\n", $FAIL_UNTESTED, scalar(@{$res->{$FAIL_UNTESTED}}) if (scalar(@{$res->{$FAIL_UNTESTED}}));
834 printf " | %-40s | %7d |\n", $FAIL_DISAPPEARS, scalar(@{$res->{$FAIL_DISAPPEARS}}) if (scalar(@{$res->{$FAIL_DISAPPEARS}}));
Christophe Lyon3b675e82018-11-30 15:24:32 +0000835 printf " | %-40s | %7d |\n", $XFAIL_DISAPPEARS, scalar(@{$res->{$XFAIL_DISAPPEARS}}) if (scalar(@{$res->{$XFAIL_DISAPPEARS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200836 printf " | %-40s | %7d |\n", $XFAIL_PASS, scalar(@{$res->{$XFAIL_PASS}}) if (scalar(@{$res->{$XFAIL_PASS}}));
837 printf " | %-40s | %7d |\n", $XFAIL_XPASS, scalar(@{$res->{$XFAIL_XPASS}}) if (scalar(@{$res->{$XFAIL_XPASS}}));
838 printf " | %-40s | %7d |\n", $XFAIL_UNSUPPORTED, scalar(@{$res->{$XFAIL_UNSUPPORTED}}) if (scalar(@{$res->{$XFAIL_UNSUPPORTED}}));
839 printf " | %-40s | %7d |\n", $XFAIL_UNTESTED, scalar(@{$res->{$XFAIL_UNTESTED}}) if (scalar(@{$res->{$XFAIL_UNTESTED}}));
840 printf " | %-40s | %7d |\n", $XFAIL_APPEARS, scalar(@{$res->{$XFAIL_APPEARS}}) if (scalar(@{$res->{$XFAIL_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100841 printf " | %-40s | %7d |\n", $UNSUPPORTED_PASS, scalar(@{$res->{$UNSUPPORTED_PASS}}) if (scalar(@{$res->{$UNSUPPORTED_PASS}}));
842 printf " | %-40s | %7d |\n", $UNSUPPORTED_XFAIL, scalar(@{$res->{$UNSUPPORTED_XFAIL}}) if (scalar(@{$res->{$UNSUPPORTED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200843 printf " | %-40s | %7d |\n", $UNSUPPORTED_UNTESTED, scalar(@{$res->{$UNSUPPORTED_UNTESTED}}) if (scalar(@{$res->{$UNSUPPORTED_UNTESTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100844 printf " | %-40s | %7d |\n", $UNSUPPORTED_DISAPPEARS, scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200845 printf " | %-40s | %7d |\n", $UNSUPPORTED_APPEARS, scalar(@{$res->{$UNSUPPORTED_APPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100846 printf " | %-40s | %7d |\n", $UNTESTED_PASS, scalar(@{$res->{$UNTESTED_PASS}}) if (scalar(@{$res->{$UNTESTED_PASS}}));
847 printf " | %-40s | %7d |\n", $UNTESTED_XFAIL, scalar(@{$res->{$UNTESTED_XFAIL}}) if (scalar(@{$res->{$UNTESTED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200848 printf " | %-40s | %7d |\n", $UNTESTED_UNSUPPORTED, scalar(@{$res->{$UNTESTED_UNSUPPORTED}}) if (scalar(@{$res->{$UNTESTED_UNSUPPORTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100849 printf " | %-40s | %7d |\n", $UNTESTED_DISAPPEARS, scalar(@{$res->{$UNTESTED_DISAPPEARS}}) if (scalar(@{$res->{$UNTESTED_DISAPPEARS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200850 printf " | %-40s | %7d |\n", $UNTESTED_APPEARS, scalar(@{$res->{$UNTESTED_APPEARS}}) if (scalar(@{$res->{$UNTESTED_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100851 printf " | %-40s | %7d |\n", $UNRESOLVED_PASS, scalar(@{$res->{$UNRESOLVED_PASS}}) if (scalar(@{$res->{$UNRESOLVED_PASS}}));
852 printf " | %-40s | %7d |\n", $UNRESOLVED_XFAIL, scalar(@{$res->{$UNRESOLVED_XFAIL}}) if (scalar(@{$res->{$UNRESOLVED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200853 printf " | %-40s | %7d |\n", $UNRESOLVED_UNSUPPORTED, scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}) if (scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}));
854 printf " | %-40s | %7d |\n", $UNRESOLVED_UNTESTED, scalar(@{$res->{$UNRESOLVED_UNTESTED}}) if (scalar(@{$res->{$UNRESOLVED_UNTESTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100855 printf " | %-40s | %7d |\n", $UNRESOLVED_DISAPPEARS, scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}) if (scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}));
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200856 printf " | %-40s | %7d |\n", $ERROR_DISAPPEARS, scalar(@{$res->{$ERROR_DISAPPEARS}}) if (scalar(@{$res->{$ERROR_DISAPPEARS}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100857 printf " | %-40s | %7d |\n", $UNHANDLED_CASES, scalar(@{$res->{$UNHANDLED_CASES}}) if (scalar(@{$res->{$UNHANDLED_CASES}}));
858 printf " | %-40s | %7d |\n", $UNSTABLE_CASES, scalar(@{$res->{$UNSTABLE_CASES}}) if (scalar(@{$res->{$UNSTABLE_CASES}}));
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000859 printf " | %-40s | %7d |\n", $HWDEP_CASES, scalar(@{$res->{$HWDEP_CASES}}) if (scalar(@{$res->{$HWDEP_CASES}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100860 printf " +------------------------------------------+---------+\n";
Christophe Lyon924cce42018-11-30 15:38:19 +0000861 printf " | %-40s | %7d |\n", "TOTAL_IMPROVEMENTS_TO_BE_CHECKED", $total_better + scalar(@{$res->{$UNSTABLE_CASES}});;
Christophe Lyonbff39612015-11-18 16:29:11 +0100862 printf " +------------------------------------------+---------+\n";
863 printf "\n";
864
865 if ($long)
866 {
Christophe Lyon28a92782017-09-13 09:00:39 +0000867 print_tclist($res, $PASS_DISAPPEARS, @{$res->{$PASS_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000868 print_tclist($res, $PASS_XFAIL, @{$res->{$PASS_XFAIL}});
869 print_tclist($res, $PASS_APPEARS, @{$res->{$PASS_APPEARS}});
870 print_tclist($res, $PASS_UNSUPPORTED, @{$res->{$PASS_UNSUPPORTED}});
871 print_tclist($res, $PASS_UNTESTED, @{$res->{$PASS_UNTESTED}});
872 print_tclist($res, $XPASS_PASS, @{$res->{$XPASS_PASS}});
873 print_tclist($res, $XPASS_XFAIL, @{$res->{$XPASS_XFAIL}});
874 print_tclist($res, $XPASS_UNSUPPORTED, @{$res->{$XPASS_UNSUPPORTED}});
875 print_tclist($res, $XPASS_UNTESTED, @{$res->{$XPASS_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000876 print_tclist($res, $XPASS_DISAPPEARS, @{$res->{$XPASS_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000877 print_tclist($res, $FAIL_PASS, @{$res->{$FAIL_PASS}});
878 print_tclist($res, $FAIL_XPASS, @{$res->{$FAIL_XPASS}});
879 print_tclist($res, $FAIL_XFAIL, @{$res->{$FAIL_XFAIL}});
880 print_tclist($res, $FAIL_UNSUPPORTED, @{$res->{$FAIL_UNSUPPORTED}});
881 print_tclist($res, $FAIL_UNTESTED, @{$res->{$FAIL_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000882 print_tclist($res, $FAIL_DISAPPEARS, @{$res->{$FAIL_DISAPPEARS}});
Christophe Lyon3b675e82018-11-30 15:24:32 +0000883 print_tclist($res, $XFAIL_DISAPPEARS, @{$res->{$XFAIL_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000884 print_tclist($res, $XFAIL_PASS, @{$res->{$XFAIL_PASS}});
885 print_tclist($res, $XFAIL_XPASS, @{$res->{$XFAIL_XPASS}});
886 print_tclist($res, $XFAIL_UNSUPPORTED, @{$res->{$XFAIL_UNSUPPORTED}});
887 print_tclist($res, $XFAIL_UNTESTED, @{$res->{$XFAIL_UNTESTED}});
888 print_tclist($res, $XFAIL_APPEARS, @{$res->{$XFAIL_APPEARS}});
889 print_tclist($res, $UNSUPPORTED_PASS, @{$res->{$UNSUPPORTED_PASS}});
890 print_tclist($res, $UNSUPPORTED_XFAIL, @{$res->{$UNSUPPORTED_XFAIL}});
891 print_tclist($res, $UNSUPPORTED_UNTESTED, @{$res->{$UNSUPPORTED_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000892 print_tclist($res, $UNSUPPORTED_DISAPPEARS, @{$res->{$UNSUPPORTED_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000893 print_tclist($res, $UNSUPPORTED_APPEARS, @{$res->{$UNSUPPORTED_APPEARS}});
894 print_tclist($res, $UNTESTED_PASS, @{$res->{$UNTESTED_PASS}});
895 print_tclist($res, $UNTESTED_XFAIL, @{$res->{$UNTESTED_XFAIL}});
896 print_tclist($res, $UNTESTED_UNSUPPORTED, @{$res->{$UNTESTED_UNSUPPORTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000897 print_tclist($res, $UNTESTED_DISAPPEARS, @{$res->{$UNTESTED_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000898 print_tclist($res, $UNTESTED_APPEARS, @{$res->{$UNTESTED_APPEARS}});
899 print_tclist($res, $UNRESOLVED_PASS, @{$res->{$UNRESOLVED_PASS}});
900 print_tclist($res, $UNRESOLVED_XFAIL, @{$res->{$UNRESOLVED_XFAIL}});
901 print_tclist($res, $UNRESOLVED_UNSUPPORTED, @{$res->{$UNRESOLVED_UNSUPPORTED}});
902 print_tclist($res, $UNRESOLVED_UNTESTED, @{$res->{$UNRESOLVED_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000903 print_tclist($res, $UNRESOLVED_DISAPPEARS, @{$res->{$UNRESOLVED_DISAPPEARS}});
904 print_tclist($res, $ERROR_DISAPPEARS, @{$res->{$ERROR_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000905 print_tclist($res, $UNHANDLED_CASES, @{$res->{$UNHANDLED_CASES}});
906 print_tclist($res, $UNSTABLE_CASES, @{$res->{$UNSTABLE_CASES}});
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000907 print_tclist($res, $HWDEP_CASES, @{$res->{$HWDEP_CASES}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100908 }
909 printf "$col_reset\n";
910 }
911
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100912 $return_value = 1 if ($total_better);
Christophe Lyonbff39612015-11-18 16:29:11 +0100913
914 $return_value = 2 if ($rtotal);
915
Christophe Lyond618f662016-02-02 19:07:58 +0100916 # Error if there was no PASS (eg when sth went wrong and no .sum was generated)
917 $return_value = 2 if (($res->{PASS} + $res->{XFAIL}) == 0);
918
919 # Error if every test passed, or the ratio was too low. This
920 # generally means the simulator is not configured well.
921 $return_value = 2 if (($ref_ratio == 100) || ($ref_ratio < $ratio_thresh));
922 $return_value = 2 if (($res_ratio == 100) || ($res_ratio < $ratio_thresh));
Christophe Lyonbff39612015-11-18 16:29:11 +0100923
Christophe Lyonad8c7242016-02-03 13:04:28 +0100924 # Error if no execution test passed.
925 # It is possible that no execution test fails, though.
926 $return_value = 2 if (($ignore_exec == 0)
927 && (($ref->{EXEC}->{PASS} == 0)
928 || ($res->{EXEC}->{PASS} == 0)));
929
Christophe Lyonbff39612015-11-18 16:29:11 +0100930 return $return_value;
931}