blob: bf391ccfd2385def44b975b4286c90dfff9ecc2e [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 Lyonc63afc92021-07-01 09:52:29 +0000285 my $current_tool="";
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000286 my $current_exp="";
Christophe Lyonbff39612015-11-18 16:29:11 +0100287
Christophe Lyonad8c7242016-02-03 13:04:28 +0100288 $res->{EXEC}->{PASS} = 0;
289 $res->{EXEC}->{FAIL} = 0;
290
Christophe Lyonbff39612015-11-18 16:29:11 +0100291 open SUMFILE, $sum_file or die $!;
292 while (<SUMFILE>)
293 {
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000294 if (m/^(PASS|XPASS|FAIL|XFAIL|UNSUPPORTED|UNTESTED|UNRESOLVED|ERROR): *(.*)/)
Christophe Lyonbff39612015-11-18 16:29:11 +0100295 {
296 my ($diag,$tc) = ($1,$2);
297 my %tcresult;
298 $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./;
Christophe Lyonc63afc92021-07-01 09:52:29 +0000299 # Prefix test name wih .exp filename to help report
300 # regressions/run bisect.
301 $tc = "$current_tool:$current_exp=$tc";
Christophe Lyonbff39612015-11-18 16:29:11 +0100302 $testcases{$tc} = empty_result() if (not exists $testcases{$tc});
303 $testcases{$tc}->{$diag}++;
304 $testcases{$tc}->{HAS_TIMED_OUT} = $pending_timeout;
Christophe Lyonc63afc92021-07-01 09:52:29 +0000305 $testcases{$tc}->{TOOL_EXP} = "$current_tool:$current_exp";
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000306 $testcases{$tc}->{NB}++;
Christophe Lyonbff39612015-11-18 16:29:11 +0100307 $pending_timeout = 0;
308 $res->{$diag}++;
Christophe Lyonad8c7242016-02-03 13:04:28 +0100309 # Count execution tests, for a sanity check
310 if ($tc =~ /execution/)
311 {
312 $res->{EXEC}->{$diag}++;
313 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100314 }
315 elsif (m/WARNING: program timed out/)
316 {
317 $pending_timeout = 1;
318 }
319 elsif (m/^(# of expected passes|# of unexpected failures|# of expected failures|# of known failures|# of unsupported tests|# of untested testcases)\s+(.*)/)
320 {
321 $res->{"summary - "."$1"} = $2;
322 }
323 elsif (m/^\/.*\/([^\/]+)\s+version\s+(.*)/)
324 {
325 $res->{tool} = $1;
326 $res->{version} = $2;
327 $res->{version} =~ s/ [-(].*//;
328 }
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000329 elsif (m/^Running target .*/)
330 {
331 }
332 elsif (m/^Running (.*) \.\.\.*/)
333 {
334 $current_exp=$1;
335 $current_exp =~ s|.*/testsuite/||;
336 }
Christophe Lyonc63afc92021-07-01 09:52:29 +0000337 elsif (m/^\t\t=== (.*) tests ===/)
338 {
339 $current_tool=$1;
340 }
341 elsif (m/^\t\t=== (.*) Summary ===/)
342 {
343 $current_tool="";
344 $current_exp="";
345 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100346 }
347 close SUMFILE;
348 return $res;
349}
350
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000351# Parse list of unstable/hw-dependent tests
Christophe Lyonbff39612015-11-18 16:29:11 +0100352sub read_unstable($)
353{
354 my ($unstable_file) = @_;
355 my @unstable_tests = ();
356
357 open UNSTABLEFILE, $unstable_file or die $!;
358 while (<UNSTABLEFILE>)
359 {
360 # Skip lines starting with '#', or with spaces only
361 if ((/^#/) || (/^[ ]*$/))
362 {
363 }
364 else
365 {
366 chomp;
367
368 my $test = $_;
369
370 # Check if line is of type: target:testname
Christophe Lyon5e7241c2015-12-04 12:57:27 +0100371 if (/^(.*?):/)
Christophe Lyonbff39612015-11-18 16:29:11 +0100372 {
373 foreach my $unstable_marker (@unstable_markers)
374 {
375 if ($unstable_marker eq $1) {
376 # If target matches the one supplied as script
377 # argument, add the testname to the list
Christophe Lyon5e7241c2015-12-04 12:57:27 +0100378 $test =~ s/.*?://;
Christophe Lyonbff39612015-11-18 16:29:11 +0100379 push @unstable_tests, $test;
380 }
381 }
382 } else {
383 push @unstable_tests, $test;
384 }
385 }
386 }
387 close UNSTABLEFILE;
388 return @unstable_tests;
389}
390
391######################################################
392# DIFFING
393sub handle_pass_fail($$$$)
394{
395 my ($ref, $res, $diag_diag, $tc) = @_;
396 if ($res->{testcases}->{$tc}->{HAS_TIMED_OUT})
397 {
398 push @{$res->{$PASSED_NOW_TIMEOUTS}}, $tc;
399 }
400 else
401 {
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000402 # This transition is flagged as hw-dependent if:
403 # - the name is in the list
404 # - the transition should not be reported (but be flagged as hw-dependent instead)
405 # - --no-hwdep was not provided
406 if ((grep { (index $tc,$_)!=-1} @hwdep_list)
407 && ($diag_diag->{report_hwdep} eq "false")
408 && ($no_hwdep == 0)) {
409 push @{$res->{$HWDEP_CASES}}, $tc;
410 } else {
411 push @{$res->{$PASS_FAIL}}, $tc;
412 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100413 }
414}
415
416sub compare_results($$)
417{
418 my ($ref, $res) = @_;
419
Christophe Lyondded4d82016-06-28 18:12:38 +0200420 @{$res->{$PASS_PASS}} = ();
Christophe Lyondded4d82016-06-28 18:12:38 +0200421 @{$res->{$PASS_XPASS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200422 @{$res->{$PASS_FAIL}} = ();
423 @{$res->{$PASS_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200424 @{$res->{$PASS_UNSUPPORTED}} = ();
425 @{$res->{$PASS_UNTESTED}} = ();
426 @{$res->{$PASS_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200427 @{$res->{$PASS_DISAPPEARS}} = ();
428 @{$res->{$PASS_APPEARS}} = ();
429 @{$res->{$PASSED_NOW_TIMEOUTS}} = ();
430
Christophe Lyondded4d82016-06-28 18:12:38 +0200431 @{$res->{$XPASS_PASS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200432 @{$res->{$XPASS_XPASS}} = ();
433 @{$res->{$XPASS_FAIL}} = ();
434 @{$res->{$XPASS_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200435 @{$res->{$XPASS_UNSUPPORTED}} = ();
436 @{$res->{$XPASS_UNTESTED}} = ();
437 @{$res->{$XPASS_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200438 @{$res->{$XPASS_DISAPPEARS}} = ();
439 @{$res->{$XPASS_APPEARS}} = ();
440
441 @{$res->{$FAIL_PASS}} = ();
442 @{$res->{$FAIL_XPASS}} = ();
443 @{$res->{$FAIL_FAIL}} = ();
444 @{$res->{$FAIL_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200445 @{$res->{$FAIL_UNSUPPORTED}} = ();
446 @{$res->{$FAIL_UNTESTED}} = ();
447 @{$res->{$FAIL_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200448 @{$res->{$FAIL_DISAPPEARS}} = ();
449 @{$res->{$FAIL_APPEARS}} = ();
450
Christophe Lyondded4d82016-06-28 18:12:38 +0200451 @{$res->{$XFAIL_PASS}} = ();
452 @{$res->{$XFAIL_XPASS}} = ();
453 @{$res->{$XFAIL_FAIL}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200454 @{$res->{$XFAIL_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200455 @{$res->{$XFAIL_UNSUPPORTED}} = ();
456 @{$res->{$XFAIL_UNTESTED}} = ();
457 @{$res->{$XFAIL_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200458 @{$res->{$XFAIL_DISAPPEARS}} = ();
459 @{$res->{$XFAIL_APPEARS}} = ();
460
Christophe Lyona140aa82015-12-17 22:53:03 +0100461 @{$res->{$UNSUPPORTED_PASS}} = ();
462 @{$res->{$UNSUPPORTED_XPASS}} = ();
463 @{$res->{$UNSUPPORTED_FAIL}} = ();
464 @{$res->{$UNSUPPORTED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200465 @{$res->{$UNSUPPORTED_UNSUPPORTED}} = ();
466 @{$res->{$UNSUPPORTED_UNTESTED}} = ();
467 @{$res->{$UNSUPPORTED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100468 @{$res->{$UNSUPPORTED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200469 @{$res->{$UNSUPPORTED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200470
Christophe Lyona140aa82015-12-17 22:53:03 +0100471 @{$res->{$UNTESTED_PASS}} = ();
472 @{$res->{$UNTESTED_XPASS}} = ();
473 @{$res->{$UNTESTED_FAIL}} = ();
474 @{$res->{$UNTESTED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200475 @{$res->{$UNTESTED_UNSUPPORTED}} = ();
476 @{$res->{$UNTESTED_UNTESTED}} = ();
477 @{$res->{$UNTESTED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100478 @{$res->{$UNTESTED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200479 @{$res->{$UNTESTED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200480
Christophe Lyona140aa82015-12-17 22:53:03 +0100481 @{$res->{$UNRESOLVED_PASS}} = ();
482 @{$res->{$UNRESOLVED_XPASS}} = ();
483 @{$res->{$UNRESOLVED_FAIL}} = ();
484 @{$res->{$UNRESOLVED_XFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200485 @{$res->{$UNRESOLVED_UNSUPPORTED}} = ();
486 @{$res->{$UNRESOLVED_UNTESTED}} = ();
487 @{$res->{$UNRESOLVED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100488 @{$res->{$UNRESOLVED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200489 @{$res->{$UNRESOLVED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200490
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200491 @{$res->{$ERROR_DISAPPEARS}} = ();
492 @{$res->{$ERROR_APPEARS}} = ();
493
Christophe Lyonbff39612015-11-18 16:29:11 +0100494 @{$res->{$UNHANDLED_CASES}} = ();
495 @{$res->{$UNSTABLE_CASES}} = ();
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000496 @{$res->{$HWDEP_CASES}} = ();
Christophe Lyonbff39612015-11-18 16:29:11 +0100497
498 #### MERGE REF AND RES
499 foreach my $key (sort (keys %{$res->{testcases}}))
500 {
501 if (not exists $ref->{testcases}->{$key}) {
502 $ref->{testcases}->{$key} = empty_result();
503 $ref->{testcases}->{$key}->{NO_EXIST} = 1;
Christophe Lyonc63afc92021-07-01 09:52:29 +0000504 $ref->{testcases}->{$key}->{TOOL_EXP} = $res->{testcases}->{$key}->{TOOL_EXP};
Christophe Lyonbff39612015-11-18 16:29:11 +0100505 }
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000506
507 # Consistency check, useful in case of duplicate test names
508 if ($ref->{testcases}->{$key}->{NB} != $res->{testcases}->{$key}->{NB}) {
509 print "Number of occurrences mismatch $key (ref $ref->{testcases}->{$key}->{NB} vs $res->{testcases}->{$key}->{NB})\n" if ($debug);
510 if ($ref->{testcases}->{$key}->{NB} > $res->{testcases}->{$key}->{NB}) {
511 $res->{testcases}->{$key}->{NO_EXIST} = 1;
512 } elsif ($ref->{testcases}->{$key}->{NB} < $res->{testcases}->{$key}->{NB}) {
513 $ref->{testcases}->{$key}->{NO_EXIST} = 1;
514 }
515 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100516 }
517 foreach my $key (keys %{$ref->{testcases}})
518 {
519 if (not exists $res->{testcases}->{$key})
520 {
521 $res->{testcases}->{$key} = empty_result();
522 $res->{testcases}->{$key}->{NO_EXIST} = 1;
Christophe Lyonc63afc92021-07-01 09:52:29 +0000523 $res->{testcases}->{$key}->{TOOL_EXP} = $ref->{testcases}->{$key}->{TOOL_EXP};
Christophe Lyonbff39612015-11-18 16:29:11 +0100524 }
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000525
526 # No need for similar consistency check: since we are
527 # checking for tests whose number of occurrences are
528 # different, they are present in both ref and res, so
529 # no need to check again here.
Christophe Lyonbff39612015-11-18 16:29:11 +0100530 }
531
532 #### ACTIONS FOR EACH CASES
533 my %unstable_found;
534
535 foreach my $key (sort (keys %{$ref->{testcases}}))
536 {
537 foreach my $diag_diag (@handler_list)
538 {
539 if ($ref->{testcases}->{$key}->{$diag_diag->{was}} != $res->{testcases}->{$key}->{$diag_diag->{was}}
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000540 and $ref->{testcases}->{$key}->{$diag_diag->{was}}
Christophe Lyonbff39612015-11-18 16:29:11 +0100541 and $res->{testcases}->{$key}->{$diag_diag->{is}})
542 {
Christophe Lyon1ed93102021-06-30 23:04:43 +0000543 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 +0000544 # If testcase is listed as 'unstable' mark it as such
545 # and skip other processing to avoid listing it twice.
Christophe Lyonbff39612015-11-18 16:29:11 +0100546 {
547 if (grep { (index $key,$_)!=-1} @unstablelist)
548 {
549 print "[unstable] $key\n" if ($debug);
550 $unstable_found{$key}=1;
551 }
552 else {
553 print "[$diag_diag->{was} => $diag_diag->{is}] $key\n" if ($debug);
554 if ($diag_diag->{handler})
555 {
556 $diag_diag->{handler} ($ref, $res, $diag_diag, $key);
557 }
558 else
559 {
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000560 # This transition is flagged as hw-dependent if:
561 # - the name is in the list
562 # - the transition should not be reported (but be flagged as hw-dependent instead)
563 # - --no-hwdep was not provided
564 if ((grep { (index $key,$_)!=-1} @hwdep_list)
565 && ($diag_diag->{report_hwdep} eq "false")
566 && ($no_hwdep == 0)) {
567 push @{$res->{$HWDEP_CASES}}, $key;
568 } else {
569 push @{$res->{$diag_diag->{cat}}}, $key;
570 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100571 }
572 }
573 }
574 }
575 }
576 }
577 push @{$res->{$UNSTABLE_CASES}}, (sort (keys (%unstable_found))) if ($nounstable == 0);
578
579}
580
581######################################################
582# PRINTING
583sub print_tclist($@)
584{
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000585 # The 1st parameter is used to find the name of the .exp file
Christophe Lyon28a92782017-09-13 09:00:39 +0000586 # associated with the testcase.
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000587 my ($this_res, $cat, @tclist) = @_;
Christophe Lyonc63afc92021-07-01 09:52:29 +0000588 my $this_tool_exp = "";
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000589 if (scalar(@tclist))
590 {
591 print " - ".$cat.":\n\n";
592 foreach my $case (@tclist)
593 {
Christophe Lyonc63afc92021-07-01 09:52:29 +0000594 if ($this_tool_exp ne $this_res->{testcases}->{$case}->{TOOL_EXP}) {
595 $this_tool_exp = $this_res->{testcases}->{$case}->{TOOL_EXP};
596 print " Executed from: $this_tool_exp\n";
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000597 }
598 print " $case\n";
599 }
600 print "\n\n";
601 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100602}
603
604sub print_compare_results_summary($$)
605{
606 my ($ref, $res) = @_;
607 my $return_value=0;
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100608 my $total_better = 0;
Christophe Lyonbff39612015-11-18 16:29:11 +0100609 my $rtotal = 0;
610 my $quiet_reg = $quiet;
Christophe Lyond618f662016-02-02 19:07:58 +0100611 my $ref_ratio = 0;
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200612 my $ref_total = 0;
Christophe Lyond618f662016-02-02 19:07:58 +0100613 my $res_ratio = 0;
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200614 my $res_total = 0;
Christophe Lyonad8c7242016-02-03 13:04:28 +0100615 my $ignore_exec = 0;
616 my $ref_has_exec_tests = 0;
617 my $res_has_exec_tests = 0;
Christophe Lyond618f662016-02-02 19:07:58 +0100618
619 # Compute the pass ratio as a sanity check
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200620 $ref_total = $ref->{PASS} +
621 $ref->{XFAIL} +
622 $ref->{XPASS} +
623 $ref->{FAIL} +
624 $ref->{UNRESOLVED} +
625 $ref->{UNSUPPORTED} +
626 $ref->{UNTESTED};
627
628 # It is possible that no test is executed at all (for instance if
629 # RUNTESTFLAGS was too restrictive). Avoid division by 0.
630 if ($ref_total > 0) {
631 $ref_ratio = ($ref->{PASS} + $ref->{XFAIL}) /
632 $ref_total;
633 }
634
635 $res_total = $res->{PASS} +
636 $res->{XFAIL} +
637 $res->{XPASS} +
638 $res->{FAIL} +
639 $res->{UNRESOLVED} +
640 $res->{UNSUPPORTED} +
641 $res->{UNTESTED};
642
643 if ($res_total > 0) {
644 $res_ratio = ($res->{PASS} + $res->{XFAIL}) /
645 $res_total;
646 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100647
648 if (not $quiet)
649 {
650 printf "Comparing:\n";
651 printf "REFERENCE:$ref_file_name\n";
652 printf "CURRENT: $res_file_name\n\n";
653 }
654
655 #### TESTS STATUS
656 if (not $quiet and not $short)
657 {
658 printf " ` +---------+---------+\n";
Christophe Lyona140aa82015-12-17 22:53:03 +0100659 printf "o RUN STATUS: | REF | RES |\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100660 printf " +------------------------------------------+---------+---------+\n";
Christophe Lyona140aa82015-12-17 22:53:03 +0100661 printf " | %-40s | %7d | %7d |\n", "Passes [PASS]", $ref->{PASS}, $res->{PASS};
Christophe Lyonbff39612015-11-18 16:29:11 +0100662 printf " | %-40s | %7d | %7d |\n", "Unexpected fails [FAIL]", $ref->{FAIL}, $res->{FAIL};
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200663 printf " | %-40s | %7d | %7d |\n", "Errors [ERROR]", $ref->{ERROR}, $res->{ERROR};
Christophe Lyona140aa82015-12-17 22:53:03 +0100664 printf " | %-40s | %7d | %7d |\n", "Unexpected passes [XPASS]", $ref->{XPASS}, $res->{XPASS};
Christophe Lyonbff39612015-11-18 16:29:11 +0100665 printf " | %-40s | %7d | %7d |\n", "Expected fails [XFAIL]", $ref->{XFAIL}, $res->{XFAIL};
666 printf " | %-40s | %7d | %7d |\n", "Unresolved [UNRESOLVED]", $ref->{UNRESOLVED}, $res->{UNRESOLVED};
Christophe Lyona140aa82015-12-17 22:53:03 +0100667 printf " | %-40s | %7d | %7d |\n", "Unsupported [UNSUPPORTED]", $ref->{UNSUPPORTED}, $res->{UNSUPPORTED};
668 printf " | %-40s | %7d | %7d |\n", "Untested [UNTESTED]", $ref->{UNTESTED}, $res->{UNTESTED};
Christophe Lyonbff39612015-11-18 16:29:11 +0100669 printf " +------------------------------------------+---------+---------+\n";
670 printf "\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100671
Christophe Lyon3d195c22016-04-06 16:00:25 +0200672 printf " REF PASS ratio: %f\n", $ref_ratio;
673 printf " RES PASS ratio: %f\n", $res_ratio;
Christophe Lyond618f662016-02-02 19:07:58 +0100674 if ($ref_ratio < $ratio_thresh)
675 {
Christophe Lyon1176f962016-03-03 18:01:10 +0100676 printf " ***** ERROR: REF PASS ratio is abnormally low *****\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100677 }
678 if ($res_ratio < $ratio_thresh)
679 {
Christophe Lyon1176f962016-03-03 18:01:10 +0100680 printf " ***** ERROR: RES PASS ratio is abnormally low *****\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100681 }
682
Christophe Lyonad8c7242016-02-03 13:04:28 +0100683 # If both PASS and FAIL EXEC tests are zero, assume there is no
684 # execution test for this tool, and do not warn.
685 $ref_has_exec_tests = ($ref->{EXEC}->{PASS} + $ref->{EXEC}->{FAIL}) != 0;
686 if ($ref_has_exec_tests)
687 {
688 printf " ***** ERROR: No REF execution test PASSed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{PASS} == 0);
689 printf " ***** WARNING: No REF execution test FAILed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{FAIL} == 0);
690 }
691
692 $res_has_exec_tests = ($res->{EXEC}->{PASS} + $res->{EXEC}->{FAIL}) != 0;
693 if ($res_has_exec_tests)
694 {
695 printf " ***** ERROR: No RES execution test PASSed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{PASS} == 0);
696 printf " ***** WARNING: No RES execution test FAILed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{FAIL} == 0);
697 }
698
699 # Ignore number of execution tests when computing the return
700 # value, if both REF and RES have no execution test.
701 $ignore_exec = !$ref_has_exec_tests && !$res_has_exec_tests;
Christophe Lyonbff39612015-11-18 16:29:11 +0100702 }
703
704 #### REGRESSIONS ?
Christophe Lyon9dde3332016-06-28 23:00:00 +0200705 $rtotal = scalar(@{$res->{$PASS_XPASS}})
706 +scalar(@{$res->{$PASS_FAIL}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200707 +scalar(@{$res->{$PASS_UNRESOLVED}})
708 +scalar(@{$res->{$PASSED_NOW_TIMEOUTS}})
Christophe Lyon30037832018-11-30 15:33:20 +0000709 +scalar(@{$res->{$ERROR_APPEARS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200710 +scalar(@{$res->{$XPASS_FAIL}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100711 +scalar(@{$res->{$XPASS_APPEARS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200712 +scalar(@{$res->{$XPASS_UNRESOLVED}})
713 +scalar(@{$res->{$FAIL_APPEARS}})
714 +scalar(@{$res->{$FAIL_UNRESOLVED}})
Christophe Lyondded4d82016-06-28 18:12:38 +0200715 +scalar(@{$res->{$XFAIL_FAIL}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200716 +scalar(@{$res->{$XFAIL_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100717 +scalar(@{$res->{$UNSUPPORTED_FAIL}})
718 +scalar(@{$res->{$UNSUPPORTED_XPASS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200719 +scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100720 +scalar(@{$res->{$UNTESTED_FAIL}})
721 +scalar(@{$res->{$UNTESTED_XPASS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200722 +scalar(@{$res->{$UNTESTED_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100723 +scalar(@{$res->{$UNRESOLVED_FAIL}})
724 +scalar(@{$res->{$UNRESOLVED_XPASS}})
Christophe Lyon30037832018-11-30 15:33:20 +0000725 +scalar(@{$res->{$UNRESOLVED_APPEARS}});
Christophe Lyona140aa82015-12-17 22:53:03 +0100726
727 $quiet_reg=1 if ($short and not $rtotal);
Christophe Lyonbff39612015-11-18 16:29:11 +0100728
729 if (not $quiet_reg)
730 {
Christophe Lyona140aa82015-12-17 22:53:03 +0100731 printf "\n$col_red"."o REGRESSIONS:\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100732 printf " +------------------------------------------+---------+\n";
Christophe Lyondded4d82016-06-28 18:12:38 +0200733 printf " | %-40s | %7d |\n", $PASS_XPASS, scalar(@{$res->{$PASS_XPASS}}) if (scalar(@{$res->{$PASS_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200734 printf " | %-40s | %7d |\n", $PASS_FAIL, scalar(@{$res->{$PASS_FAIL}}) if (scalar(@{$res->{$PASS_FAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200735 printf " | %-40s | %7d |\n", $PASS_UNRESOLVED, scalar(@{$res->{$PASS_UNRESOLVED}}) if (scalar(@{$res->{$PASS_UNRESOLVED}}));
736 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 +0200737 printf " | %-40s | %7d |\n", $ERROR_APPEARS, scalar(@{$res->{$ERROR_APPEARS}}) if (scalar(@{$res->{$ERROR_APPEARS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200738 printf " | %-40s | %7d |\n", $XPASS_FAIL, scalar(@{$res->{$XPASS_FAIL}}) if (scalar(@{$res->{$XPASS_FAIL}}));
739 printf " | %-40s | %7d |\n", $XPASS_APPEARS, scalar(@{$res->{$XPASS_APPEARS}}) if (scalar(@{$res->{$XPASS_APPEARS}}));
740 printf " | %-40s | %7d |\n", $XPASS_UNRESOLVED, scalar(@{$res->{$XPASS_UNRESOLVED}}) if (scalar(@{$res->{$XPASS_UNRESOLVED}}));
741 printf " | %-40s | %7d |\n", $FAIL_APPEARS, scalar(@{$res->{$FAIL_APPEARS}}) if (scalar(@{$res->{$FAIL_APPEARS}}));
742 printf " | %-40s | %7d |\n", $FAIL_UNRESOLVED, scalar(@{$res->{$FAIL_UNRESOLVED}}) if (scalar(@{$res->{$FAIL_UNRESOLVED}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200743 printf " | %-40s | %7d |\n", $XFAIL_FAIL, scalar(@{$res->{$XFAIL_FAIL}}) if (scalar(@{$res->{$XFAIL_FAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200744 printf " | %-40s | %7d |\n", $XFAIL_UNRESOLVED, scalar(@{$res->{$XFAIL_UNRESOLVED}}) if (scalar(@{$res->{$XFAIL_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100745 printf " | %-40s | %7d |\n", $UNSUPPORTED_FAIL, scalar(@{$res->{$UNSUPPORTED_FAIL}}) if (scalar(@{$res->{$UNSUPPORTED_FAIL}}));
746 printf " | %-40s | %7d |\n", $UNSUPPORTED_XPASS, scalar(@{$res->{$UNSUPPORTED_XPASS}}) if (scalar(@{$res->{$UNSUPPORTED_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200747 printf " | %-40s | %7d |\n", $UNSUPPORTED_UNRESOLVED, scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}) if (scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100748 printf " | %-40s | %7d |\n", $UNTESTED_FAIL, scalar(@{$res->{$UNTESTED_FAIL}}) if (scalar(@{$res->{$UNTESTED_FAIL}}));
749 printf " | %-40s | %7d |\n", $UNTESTED_XPASS, scalar(@{$res->{$UNTESTED_XPASS}}) if (scalar(@{$res->{$UNTESTED_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200750 printf " | %-40s | %7d |\n", $UNTESTED_UNRESOLVED, scalar(@{$res->{$UNTESTED_UNRESOLVED}}) if (scalar(@{$res->{$UNTESTED_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100751 printf " | %-40s | %7d |\n", $UNRESOLVED_FAIL, scalar(@{$res->{$UNRESOLVED_FAIL}}) if (scalar(@{$res->{$UNRESOLVED_FAIL}}));
752 printf " | %-40s | %7d |\n", $UNRESOLVED_XPASS, scalar(@{$res->{$UNRESOLVED_XPASS}}) if (scalar(@{$res->{$UNRESOLVED_XPASS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200753 printf " | %-40s | %7d |\n", $UNRESOLVED_APPEARS, scalar(@{$res->{$UNRESOLVED_APPEARS}}) if (scalar(@{$res->{$UNRESOLVED_APPEARS}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100754 printf " +------------------------------------------+---------+\n";
755 printf " | %-40s | %7d |\n", "TOTAL_REGRESSIONS", $rtotal;
756 printf " +------------------------------------------+---------+\n";
757 printf "\n";
758
759 if ($long)
760 {
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000761 print_tclist($res, $PASS_XPASS, @{$res->{$PASS_XPASS}});
762 print_tclist($res, $PASS_FAIL, @{$res->{$PASS_FAIL}});
763 print_tclist($res, $PASS_UNRESOLVED, @{$res->{$PASS_UNRESOLVED}});
764 print_tclist($res, $PASSED_NOW_TIMEOUTS, @{$res->{$PASSED_NOW_TIMEOUTS}});
765 print_tclist($res, $ERROR_APPEARS, @{$res->{$ERROR_APPEARS}});
766 print_tclist($res, $XPASS_FAIL, @{$res->{$XPASS_FAIL}});
767 print_tclist($res, $XPASS_APPEARS, @{$res->{$XPASS_APPEARS}});
768 print_tclist($res, $XPASS_UNRESOLVED, @{$res->{$XPASS_UNRESOLVED}});
769 print_tclist($res, $FAIL_APPEARS, @{$res->{$FAIL_APPEARS}});
770 print_tclist($res, $FAIL_UNRESOLVED, @{$res->{$FAIL_UNRESOLVED}});
771 print_tclist($res, $XFAIL_FAIL, @{$res->{$XFAIL_FAIL}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000772 print_tclist($res, $XFAIL_UNRESOLVED, @{$res->{$XFAIL_UNRESOLVED}});
773 print_tclist($res, $UNSUPPORTED_FAIL, @{$res->{$UNSUPPORTED_FAIL}});
774 print_tclist($res, $UNSUPPORTED_XPASS, @{$res->{$UNSUPPORTED_XPASS}});
775 print_tclist($res, $UNSUPPORTED_UNRESOLVED, @{$res->{$UNSUPPORTED_UNRESOLVED}});
776 print_tclist($res, $UNTESTED_FAIL, @{$res->{$UNTESTED_FAIL}});
777 print_tclist($res, $UNTESTED_XPASS, @{$res->{$UNTESTED_XPASS}});
778 print_tclist($res, $UNTESTED_UNRESOLVED, @{$res->{$UNTESTED_UNRESOLVED}});
779 print_tclist($res, $UNRESOLVED_FAIL, @{$res->{$UNRESOLVED_FAIL}});
780 print_tclist($res, $UNRESOLVED_XPASS, @{$res->{$UNRESOLVED_XPASS}});
781 print_tclist($res, $UNRESOLVED_APPEARS, @{$res->{$UNRESOLVED_APPEARS}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100782 }
783 printf "$col_reset\n";
784 }
785
Christophe Lyon924cce42018-11-30 15:38:19 +0000786 #### IMPROVEMENTS TO BE CHECKED ?
Christophe Lyonbff39612015-11-18 16:29:11 +0100787 if (not $quiet and not $short)
788 {
Christophe Lyon9dde3332016-06-28 23:00:00 +0200789 $total_better =
Christophe Lyon31279df2016-07-04 17:02:12 +0200790 scalar(@{$res->{$PASS_DISAPPEARS}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200791 scalar(@{$res->{$PASS_XFAIL}})+
792 scalar(@{$res->{$PASS_APPEARS}})+
793 scalar(@{$res->{$PASS_UNSUPPORTED}})+
794 scalar(@{$res->{$PASS_UNTESTED}})+
795 scalar(@{$res->{$XPASS_PASS}})+
796 scalar(@{$res->{$XPASS_XFAIL}})+
797 scalar(@{$res->{$XPASS_UNSUPPORTED}})+
798 scalar(@{$res->{$XPASS_UNTESTED}})+
799 scalar(@{$res->{$XPASS_DISAPPEARS}})+
Christophe Lyondded4d82016-06-28 18:12:38 +0200800 scalar(@{$res->{$FAIL_PASS}})+
801 scalar(@{$res->{$FAIL_XPASS}})+
Christophe Lyondded4d82016-06-28 18:12:38 +0200802 scalar(@{$res->{$FAIL_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200803 scalar(@{$res->{$FAIL_UNSUPPORTED}})+
804 scalar(@{$res->{$FAIL_UNTESTED}})+
805 scalar(@{$res->{$FAIL_DISAPPEARS}})+
Christophe Lyon3b675e82018-11-30 15:24:32 +0000806 scalar(@{$res->{$XFAIL_DISAPPEARS}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200807 scalar(@{$res->{$XFAIL_PASS}})+
808 scalar(@{$res->{$XFAIL_XPASS}})+
809 scalar(@{$res->{$XFAIL_UNSUPPORTED}})+
810 scalar(@{$res->{$XFAIL_UNTESTED}})+
811 scalar(@{$res->{$XFAIL_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100812 scalar(@{$res->{$UNSUPPORTED_PASS}})+
813 scalar(@{$res->{$UNSUPPORTED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200814 scalar(@{$res->{$UNSUPPORTED_UNTESTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100815 scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}})+
Christophe Lyondc66fc52016-04-05 17:38:07 +0200816 scalar(@{$res->{$UNSUPPORTED_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100817 scalar(@{$res->{$UNTESTED_PASS}})+
818 scalar(@{$res->{$UNTESTED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200819 scalar(@{$res->{$UNTESTED_UNSUPPORTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100820 scalar(@{$res->{$UNTESTED_DISAPPEARS}})+
Christophe Lyondc66fc52016-04-05 17:38:07 +0200821 scalar(@{$res->{$UNTESTED_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100822 scalar(@{$res->{$UNRESOLVED_PASS}})+
823 scalar(@{$res->{$UNRESOLVED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200824 scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}})+
825 scalar(@{$res->{$UNRESOLVED_UNTESTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100826 scalar(@{$res->{$UNRESOLVED_DISAPPEARS}})+
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200827 scalar(@{$res->{$ERROR_DISAPPEARS}})+
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100828 scalar(@{$res->{$UNHANDLED_CASES}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100829
Christophe Lyon924cce42018-11-30 15:38:19 +0000830 printf "$col_pink"."o IMPROVEMENTS TO BE CHECKED:\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100831 printf " +------------------------------------------+---------+\n";
Christophe Lyon31279df2016-07-04 17:02:12 +0200832 printf " | %-40s | %7d |\n", $PASS_DISAPPEARS, scalar(@{$res->{$PASS_DISAPPEARS}}) if (scalar(@{$res->{$PASS_DISAPPEARS}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200833 printf " | %-40s | %7d |\n", $PASS_XFAIL, scalar(@{$res->{$PASS_XFAIL}}) if (scalar(@{$res->{$PASS_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200834 printf " | %-40s | %7d |\n", $PASS_APPEARS, scalar(@{$res->{$PASS_APPEARS}}) if (scalar(@{$res->{$PASS_APPEARS}}));
835 printf " | %-40s | %7d |\n", $PASS_UNSUPPORTED, scalar(@{$res->{$PASS_UNSUPPORTED}}) if (scalar(@{$res->{$PASS_UNSUPPORTED}}));
836 printf " | %-40s | %7d |\n", $PASS_UNTESTED, scalar(@{$res->{$PASS_UNTESTED}}) if (scalar(@{$res->{$PASS_UNTESTED}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200837 printf " | %-40s | %7d |\n", $XPASS_PASS, scalar(@{$res->{$XPASS_PASS}}) if (scalar(@{$res->{$XPASS_PASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200838 printf " | %-40s | %7d |\n", $XPASS_XFAIL, scalar(@{$res->{$XPASS_XFAIL}}) if (scalar(@{$res->{$XPASS_XFAIL}}));
839 printf " | %-40s | %7d |\n", $XPASS_UNSUPPORTED, scalar(@{$res->{$XPASS_UNSUPPORTED}}) if (scalar(@{$res->{$XPASS_UNSUPPORTED}}));
840 printf " | %-40s | %7d |\n", $XPASS_UNTESTED, scalar(@{$res->{$XPASS_UNTESTED}}) if (scalar(@{$res->{$XPASS_UNTESTED}}));
841 printf " | %-40s | %7d |\n", $XPASS_DISAPPEARS, scalar(@{$res->{$XPASS_DISAPPEARS}}) if (scalar(@{$res->{$XPASS_DISAPPEARS}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200842 printf " | %-40s | %7d |\n", $FAIL_PASS, scalar(@{$res->{$FAIL_PASS}}) if (scalar(@{$res->{$FAIL_PASS}}));
843 printf " | %-40s | %7d |\n", $FAIL_XPASS, scalar(@{$res->{$FAIL_XPASS}}) if (scalar(@{$res->{$FAIL_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200844 printf " | %-40s | %7d |\n", $FAIL_XFAIL, scalar(@{$res->{$FAIL_XFAIL}}) if (scalar(@{$res->{$FAIL_XFAIL}}));
845 printf " | %-40s | %7d |\n", $FAIL_UNSUPPORTED, scalar(@{$res->{$FAIL_UNSUPPORTED}}) if (scalar(@{$res->{$FAIL_UNSUPPORTED}}));
846 printf " | %-40s | %7d |\n", $FAIL_UNTESTED, scalar(@{$res->{$FAIL_UNTESTED}}) if (scalar(@{$res->{$FAIL_UNTESTED}}));
847 printf " | %-40s | %7d |\n", $FAIL_DISAPPEARS, scalar(@{$res->{$FAIL_DISAPPEARS}}) if (scalar(@{$res->{$FAIL_DISAPPEARS}}));
Christophe Lyon3b675e82018-11-30 15:24:32 +0000848 printf " | %-40s | %7d |\n", $XFAIL_DISAPPEARS, scalar(@{$res->{$XFAIL_DISAPPEARS}}) if (scalar(@{$res->{$XFAIL_DISAPPEARS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200849 printf " | %-40s | %7d |\n", $XFAIL_PASS, scalar(@{$res->{$XFAIL_PASS}}) if (scalar(@{$res->{$XFAIL_PASS}}));
850 printf " | %-40s | %7d |\n", $XFAIL_XPASS, scalar(@{$res->{$XFAIL_XPASS}}) if (scalar(@{$res->{$XFAIL_XPASS}}));
851 printf " | %-40s | %7d |\n", $XFAIL_UNSUPPORTED, scalar(@{$res->{$XFAIL_UNSUPPORTED}}) if (scalar(@{$res->{$XFAIL_UNSUPPORTED}}));
852 printf " | %-40s | %7d |\n", $XFAIL_UNTESTED, scalar(@{$res->{$XFAIL_UNTESTED}}) if (scalar(@{$res->{$XFAIL_UNTESTED}}));
853 printf " | %-40s | %7d |\n", $XFAIL_APPEARS, scalar(@{$res->{$XFAIL_APPEARS}}) if (scalar(@{$res->{$XFAIL_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100854 printf " | %-40s | %7d |\n", $UNSUPPORTED_PASS, scalar(@{$res->{$UNSUPPORTED_PASS}}) if (scalar(@{$res->{$UNSUPPORTED_PASS}}));
855 printf " | %-40s | %7d |\n", $UNSUPPORTED_XFAIL, scalar(@{$res->{$UNSUPPORTED_XFAIL}}) if (scalar(@{$res->{$UNSUPPORTED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200856 printf " | %-40s | %7d |\n", $UNSUPPORTED_UNTESTED, scalar(@{$res->{$UNSUPPORTED_UNTESTED}}) if (scalar(@{$res->{$UNSUPPORTED_UNTESTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100857 printf " | %-40s | %7d |\n", $UNSUPPORTED_DISAPPEARS, scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200858 printf " | %-40s | %7d |\n", $UNSUPPORTED_APPEARS, scalar(@{$res->{$UNSUPPORTED_APPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100859 printf " | %-40s | %7d |\n", $UNTESTED_PASS, scalar(@{$res->{$UNTESTED_PASS}}) if (scalar(@{$res->{$UNTESTED_PASS}}));
860 printf " | %-40s | %7d |\n", $UNTESTED_XFAIL, scalar(@{$res->{$UNTESTED_XFAIL}}) if (scalar(@{$res->{$UNTESTED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200861 printf " | %-40s | %7d |\n", $UNTESTED_UNSUPPORTED, scalar(@{$res->{$UNTESTED_UNSUPPORTED}}) if (scalar(@{$res->{$UNTESTED_UNSUPPORTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100862 printf " | %-40s | %7d |\n", $UNTESTED_DISAPPEARS, scalar(@{$res->{$UNTESTED_DISAPPEARS}}) if (scalar(@{$res->{$UNTESTED_DISAPPEARS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200863 printf " | %-40s | %7d |\n", $UNTESTED_APPEARS, scalar(@{$res->{$UNTESTED_APPEARS}}) if (scalar(@{$res->{$UNTESTED_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100864 printf " | %-40s | %7d |\n", $UNRESOLVED_PASS, scalar(@{$res->{$UNRESOLVED_PASS}}) if (scalar(@{$res->{$UNRESOLVED_PASS}}));
865 printf " | %-40s | %7d |\n", $UNRESOLVED_XFAIL, scalar(@{$res->{$UNRESOLVED_XFAIL}}) if (scalar(@{$res->{$UNRESOLVED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200866 printf " | %-40s | %7d |\n", $UNRESOLVED_UNSUPPORTED, scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}) if (scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}));
867 printf " | %-40s | %7d |\n", $UNRESOLVED_UNTESTED, scalar(@{$res->{$UNRESOLVED_UNTESTED}}) if (scalar(@{$res->{$UNRESOLVED_UNTESTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100868 printf " | %-40s | %7d |\n", $UNRESOLVED_DISAPPEARS, scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}) if (scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}));
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200869 printf " | %-40s | %7d |\n", $ERROR_DISAPPEARS, scalar(@{$res->{$ERROR_DISAPPEARS}}) if (scalar(@{$res->{$ERROR_DISAPPEARS}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100870 printf " | %-40s | %7d |\n", $UNHANDLED_CASES, scalar(@{$res->{$UNHANDLED_CASES}}) if (scalar(@{$res->{$UNHANDLED_CASES}}));
871 printf " | %-40s | %7d |\n", $UNSTABLE_CASES, scalar(@{$res->{$UNSTABLE_CASES}}) if (scalar(@{$res->{$UNSTABLE_CASES}}));
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000872 printf " | %-40s | %7d |\n", $HWDEP_CASES, scalar(@{$res->{$HWDEP_CASES}}) if (scalar(@{$res->{$HWDEP_CASES}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100873 printf " +------------------------------------------+---------+\n";
Christophe Lyon924cce42018-11-30 15:38:19 +0000874 printf " | %-40s | %7d |\n", "TOTAL_IMPROVEMENTS_TO_BE_CHECKED", $total_better + scalar(@{$res->{$UNSTABLE_CASES}});;
Christophe Lyonbff39612015-11-18 16:29:11 +0100875 printf " +------------------------------------------+---------+\n";
876 printf "\n";
877
878 if ($long)
879 {
Christophe Lyon28a92782017-09-13 09:00:39 +0000880 print_tclist($res, $PASS_DISAPPEARS, @{$res->{$PASS_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000881 print_tclist($res, $PASS_XFAIL, @{$res->{$PASS_XFAIL}});
882 print_tclist($res, $PASS_APPEARS, @{$res->{$PASS_APPEARS}});
883 print_tclist($res, $PASS_UNSUPPORTED, @{$res->{$PASS_UNSUPPORTED}});
884 print_tclist($res, $PASS_UNTESTED, @{$res->{$PASS_UNTESTED}});
885 print_tclist($res, $XPASS_PASS, @{$res->{$XPASS_PASS}});
886 print_tclist($res, $XPASS_XFAIL, @{$res->{$XPASS_XFAIL}});
887 print_tclist($res, $XPASS_UNSUPPORTED, @{$res->{$XPASS_UNSUPPORTED}});
888 print_tclist($res, $XPASS_UNTESTED, @{$res->{$XPASS_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000889 print_tclist($res, $XPASS_DISAPPEARS, @{$res->{$XPASS_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000890 print_tclist($res, $FAIL_PASS, @{$res->{$FAIL_PASS}});
891 print_tclist($res, $FAIL_XPASS, @{$res->{$FAIL_XPASS}});
892 print_tclist($res, $FAIL_XFAIL, @{$res->{$FAIL_XFAIL}});
893 print_tclist($res, $FAIL_UNSUPPORTED, @{$res->{$FAIL_UNSUPPORTED}});
894 print_tclist($res, $FAIL_UNTESTED, @{$res->{$FAIL_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000895 print_tclist($res, $FAIL_DISAPPEARS, @{$res->{$FAIL_DISAPPEARS}});
Christophe Lyon3b675e82018-11-30 15:24:32 +0000896 print_tclist($res, $XFAIL_DISAPPEARS, @{$res->{$XFAIL_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000897 print_tclist($res, $XFAIL_PASS, @{$res->{$XFAIL_PASS}});
898 print_tclist($res, $XFAIL_XPASS, @{$res->{$XFAIL_XPASS}});
899 print_tclist($res, $XFAIL_UNSUPPORTED, @{$res->{$XFAIL_UNSUPPORTED}});
900 print_tclist($res, $XFAIL_UNTESTED, @{$res->{$XFAIL_UNTESTED}});
901 print_tclist($res, $XFAIL_APPEARS, @{$res->{$XFAIL_APPEARS}});
902 print_tclist($res, $UNSUPPORTED_PASS, @{$res->{$UNSUPPORTED_PASS}});
903 print_tclist($res, $UNSUPPORTED_XFAIL, @{$res->{$UNSUPPORTED_XFAIL}});
904 print_tclist($res, $UNSUPPORTED_UNTESTED, @{$res->{$UNSUPPORTED_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000905 print_tclist($res, $UNSUPPORTED_DISAPPEARS, @{$res->{$UNSUPPORTED_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000906 print_tclist($res, $UNSUPPORTED_APPEARS, @{$res->{$UNSUPPORTED_APPEARS}});
907 print_tclist($res, $UNTESTED_PASS, @{$res->{$UNTESTED_PASS}});
908 print_tclist($res, $UNTESTED_XFAIL, @{$res->{$UNTESTED_XFAIL}});
909 print_tclist($res, $UNTESTED_UNSUPPORTED, @{$res->{$UNTESTED_UNSUPPORTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000910 print_tclist($res, $UNTESTED_DISAPPEARS, @{$res->{$UNTESTED_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000911 print_tclist($res, $UNTESTED_APPEARS, @{$res->{$UNTESTED_APPEARS}});
912 print_tclist($res, $UNRESOLVED_PASS, @{$res->{$UNRESOLVED_PASS}});
913 print_tclist($res, $UNRESOLVED_XFAIL, @{$res->{$UNRESOLVED_XFAIL}});
914 print_tclist($res, $UNRESOLVED_UNSUPPORTED, @{$res->{$UNRESOLVED_UNSUPPORTED}});
915 print_tclist($res, $UNRESOLVED_UNTESTED, @{$res->{$UNRESOLVED_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000916 print_tclist($res, $UNRESOLVED_DISAPPEARS, @{$res->{$UNRESOLVED_DISAPPEARS}});
917 print_tclist($res, $ERROR_DISAPPEARS, @{$res->{$ERROR_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000918 print_tclist($res, $UNHANDLED_CASES, @{$res->{$UNHANDLED_CASES}});
919 print_tclist($res, $UNSTABLE_CASES, @{$res->{$UNSTABLE_CASES}});
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000920 print_tclist($res, $HWDEP_CASES, @{$res->{$HWDEP_CASES}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100921 }
922 printf "$col_reset\n";
923 }
924
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100925 $return_value = 1 if ($total_better);
Christophe Lyonbff39612015-11-18 16:29:11 +0100926
927 $return_value = 2 if ($rtotal);
928
Christophe Lyond618f662016-02-02 19:07:58 +0100929 # Error if there was no PASS (eg when sth went wrong and no .sum was generated)
930 $return_value = 2 if (($res->{PASS} + $res->{XFAIL}) == 0);
931
932 # Error if every test passed, or the ratio was too low. This
933 # generally means the simulator is not configured well.
934 $return_value = 2 if (($ref_ratio == 100) || ($ref_ratio < $ratio_thresh));
935 $return_value = 2 if (($res_ratio == 100) || ($res_ratio < $ratio_thresh));
Christophe Lyonbff39612015-11-18 16:29:11 +0100936
Christophe Lyonad8c7242016-02-03 13:04:28 +0100937 # Error if no execution test passed.
938 # It is possible that no execution test fails, though.
939 $return_value = 2 if (($ignore_exec == 0)
940 && (($ref->{EXEC}->{PASS} == 0)
941 || ($res->{EXEC}->{PASS} == 0)));
942
Christophe Lyonbff39612015-11-18 16:29:11 +0100943 return $return_value;
944}