blob: 6eec385086a0e1993540702f5c08afdffffc4937 [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]";
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +000025my $PASS_KFAIL = "PASS now KFAIL [PASS =>KFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020026my $PASS_UNSUPPORTED = "PASS now UNSUPPORTED [PASS =>UNSUP]";
27my $PASS_UNRESOLVED = "PASS now UNRESOLVED [PASS =>UNRES]";
28my $PASS_UNTESTED = "PASS now UNTESTED [PASS =>UNTES]";
Christophe Lyona140aa82015-12-17 22:53:03 +010029my $PASS_DISAPPEARS = "PASS disappears [PASS => ]";
Christophe Lyon71cec962016-06-28 18:27:30 +020030my $PASS_APPEARS = "New PASS [ => PASS]";
31my $PASSED_NOW_TIMEOUTS = "Timeout [PASS =>T.OUT]";
32
33my $XPASS_PASS = "XPASS now PASS [XPASS=> PASS]";
34my $XPASS_XPASS = "Still xpass [XPASS=>XPASS]";
Christophe Lyondded4d82016-06-28 18:12:38 +020035my $XPASS_FAIL = "XPASS now FAIL [XPASS=> FAIL]";
Christophe Lyon71cec962016-06-28 18:27:30 +020036my $XPASS_XFAIL = "XPASS now XFAIL [XPASS=>XFAIL]";
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +000037my $XPASS_KFAIL = "XPASS now KFAIL [XPASS=>KFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020038my $XPASS_UNSUPPORTED = "XPASS now UNSUPPORTED [XPASS=>UNSUP]";
39my $XPASS_UNRESOLVED = "XPASS now UNRESOLVED [XPASS=>UNRES]";
40my $XPASS_UNTESTED = "XPASS now UNTESTED [XPASS=>UNTES]";
Christophe Lyon71cec962016-06-28 18:27:30 +020041my $XPASS_DISAPPEARS = "XPASS disappears [XPASS=> ]";
42my $XPASS_APPEARS = "XPASS appears [ =>XPASS]";
43
44my $FAIL_PASS = "FAIL now PASS [FAIL => PASS]";
45my $FAIL_XPASS = "FAIL now XPASS [FAIL =>XPASS]";
46my $FAIL_FAIL = "Still fails [FAIL => FAIL]";
47my $FAIL_XFAIL = "FAIL now XFAIL [FAIL =>XFAIL]";
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +000048my $FAIL_KFAIL = "FAIL now KFAIL [FAIL =>KFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020049my $FAIL_UNSUPPORTED = "FAIL now UNSUPPORTED [FAIL =>UNSUP]";
50my $FAIL_UNRESOLVED = "FAIL now UNRESOLVED [FAIL =>UNRES]";
51my $FAIL_UNTESTED = "FAIL now UNTESTED [FAIL =>UNTES]";
Christophe Lyon71cec962016-06-28 18:27:30 +020052my $FAIL_DISAPPEARS = "FAIL disappears [FAIL => ]";
53my $FAIL_APPEARS = "FAIL appears [ => FAIL]";
54
55my $XFAIL_PASS = "XFAIL now PASS [XFAIL=> PASS]";
56my $XFAIL_XPASS = "XFAIL now XPASS [XFAIL=>XPASS]";
Christophe Lyondded4d82016-06-28 18:12:38 +020057my $XFAIL_FAIL = "XFAIL now FAIL [XFAIL=> FAIL]";
Christophe Lyon71cec962016-06-28 18:27:30 +020058my $XFAIL_XFAIL = "Still xfail [XFAIL=>XFAIL]";
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +000059my $XFAIL_KFAIL = "XFAIL now KFAIL [XFAIL=>KFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020060my $XFAIL_UNSUPPORTED = "XFAIL now UNSUPPORTED [XFAIL=>UNSUP]";
61my $XFAIL_UNRESOLVED = "XFAIL now UNRESOLVED [XFAIL=>UNRES]";
62my $XFAIL_UNTESTED = "XFAIL now UNTESTED [XFAIL=>UNTES]";
Christophe Lyona140aa82015-12-17 22:53:03 +010063my $XFAIL_DISAPPEARS = "XFAIL disappears [XFAIL=> ]";
Christophe Lyon71cec962016-06-28 18:27:30 +020064my $XFAIL_APPEARS = "XFAIL appears [ =>XFAIL]";
Christophe Lyona140aa82015-12-17 22:53:03 +010065
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +000066my $KFAIL_PASS = "KFAIL now PASS [KFAIL=> PASS]";
67my $KFAIL_XPASS = "KFAIL now XPASS [KFAIL=>XPASS]";
68my $KFAIL_FAIL = "KFAIL now FAIL [KFAIL=> FAIL]";
69my $KFAIL_XFAIL = "KFAIL now XFAIL [KFAIL=>XFAIL]";
70my $KFAIL_KFAIL = "Still kfail [KFAIL=>KFAIL]";
71my $KFAIL_UNSUPPORTED = "KFAIL now UNSUPPORTED [KFAIL=>UNSUP]";
72my $KFAIL_UNRESOLVED = "KFAIL now UNRESOLVED [KFAIL=>UNRES]";
73my $KFAIL_UNTESTED = "KFAIL now UNTESTED [KFAIL=>UNTES]";
74my $KFAIL_DISAPPEARS = "KFAIL disappears [KFAIL=> ]";
75my $KFAIL_APPEARS = "KFAIL appears [ =>KFAIL]";
76
Christophe Lyona140aa82015-12-17 22:53:03 +010077my $UNSUPPORTED_PASS = "UNSUPPORTED now PASS [UNSUP=> PASS]";
Christophe Lyon71cec962016-06-28 18:27:30 +020078my $UNSUPPORTED_XPASS = "UNSUPPORTED now XPASS [UNSUP=>XPASS]";
Christophe Lyona140aa82015-12-17 22:53:03 +010079my $UNSUPPORTED_FAIL = "UNSUPPORTED now FAIL [UNSUP=> FAIL]";
Christophe Lyon71cec962016-06-28 18:27:30 +020080my $UNSUPPORTED_XFAIL = "UNSUPPORTED now XFAIL [UNSUP=>XFAIL]";
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +000081my $UNSUPPORTED_KFAIL = "UNSUPPORTED now KFAIL [UNSUP=>KFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020082my $UNSUPPORTED_UNSUPPORTED= "UNSUPP now UNSUPP [UNSUP=>UNSUP]";
83my $UNSUPPORTED_UNRESOLVED= "UNSUPP now UNRESOLVED [UNSUP=>UNRES]";
84my $UNSUPPORTED_UNTESTED = "UNSUPP now UNTESTED [UNSUP=>UNTES]";
Christophe Lyon71cec962016-06-28 18:27:30 +020085my $UNSUPPORTED_DISAPPEARS= "UNSUPPORTED disappears [UNSUP=> ]";
86my $UNSUPPORTED_APPEARS = "UNSUPPORTED appears [ =>UNSUP]";
87
88my $UNTESTED_PASS = "UNTESTED now PASS [UNTES=> PASS]";
Christophe Lyona140aa82015-12-17 22:53:03 +010089my $UNTESTED_XPASS = "UNTESTED now XPASS [UNTES=>XPASS]";
Christophe Lyon71cec962016-06-28 18:27:30 +020090my $UNTESTED_FAIL = "UNTESTED now FAIL [UNTES=> FAIL]";
91my $UNTESTED_XFAIL = "UNTESTED now XFAIL [UNTES=>XFAIL]";
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +000092my $UNTESTED_KFAIL = "UNTESTED now KFAIL [UNTES=>KFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +020093my $UNTESTED_UNSUPPORTED = "UNTESTED now UNSUPP [UNTES=>UNSUP]";
94my $UNTESTED_UNRESOLVED = "UNTESTED now UNRESOLVED [UNTES=>UNRES]";
95my $UNTESTED_UNTESTED = "UNTESTED now UNTESTED [UNTES=>UNTES]";
Christophe Lyon71cec962016-06-28 18:27:30 +020096my $UNTESTED_DISAPPEARS = "UNTESTED disappears [UNTES=> ]";
97my $UNTESTED_APPEARS = "UNTESTED appears [ =>UNTES]";
98
99my $UNRESOLVED_PASS = "UNRESOLVED now PASS [UNRES=> PASS]";
Christophe Lyona140aa82015-12-17 22:53:03 +0100100my $UNRESOLVED_XPASS = "UNRESOLVED now XPASS [UNRES=>XPASS]";
Christophe Lyon71cec962016-06-28 18:27:30 +0200101my $UNRESOLVED_FAIL = "UNRESOLVED now FAIL [UNRES=> FAIL]";
102my $UNRESOLVED_XFAIL = "UNRESOLVED now XFAIL [UNRES=>XFAIL]";
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000103my $UNRESOLVED_KFAIL = "UNRESOLVED now KFAIL [UNRES=>KFAIL]";
Christophe Lyon9dde3332016-06-28 23:00:00 +0200104my $UNRESOLVED_UNSUPPORTED= "UNRESOLVED now UNSUPP [UNRES=>UNSUP]";
105my $UNRESOLVED_UNRESOLVED = "UNRESOLVED now UNRESOLVED [UNRES=>UNRES]";
106my $UNRESOLVED_UNTESTED = "UNRESOLVED now UNTESTED [UNRES=>UNTES]";
Christophe Lyon71cec962016-06-28 18:27:30 +0200107my $UNRESOLVED_DISAPPEARS = "UNRESOLVED disappears [UNRES=> ]";
108my $UNRESOLVED_APPEARS = "UNRESOLVED appears [ =>UNRES]";
109
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200110my $ERROR_DISAPPEARS = "ERROR disappears [ERROR=> ]";
111my $ERROR_APPEARS = "ERROR appears [ =>ERROR]";
112
Christophe Lyon71cec962016-06-28 18:27:30 +0200113my $UNHANDLED_CASES = "Unhandled cases [ ..??.. ]";
114my $UNSTABLE_CASES = "Unstable cases, ignored [~RANDOM ]";
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000115my $HWDEP_CASES = "HW dependent cases [HW-DEPENDENT]";
Christophe Lyonbff39612015-11-18 16:29:11 +0100116
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000117# Handle status transitions:
118# 'was' is the reference status
119# 'is' is the current status
120# 'cat' is the short name for the transition type
121# 'handler' is a function handling the transition, if non-trivial
122# report_hwdep is a boolean controlling whether to report the
123# transition even if flagged as hardware-dependent
Christophe Lyonbff39612015-11-18 16:29:11 +0100124my @handler_list = (
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000125 {was=>"PASS", is=>"PASS", cat=>$PASS_PASS, report_hwdep=>"false"},
126 {was=>"PASS", is=>"XPASS", cat=>$PASS_XPASS, report_hwdep=>"true"},
127 {was=>"PASS", is=>"FAIL", handler=>\&handle_pass_fail, report_hwdep=>"true"},
128 {was=>"PASS", is=>"XFAIL", cat=>$PASS_XFAIL, report_hwdep=>"true"},
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000129 {was=>"PASS", is=>"KFAIL", cat=>$PASS_KFAIL, report_hwdep=>"true"},
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000130 {was=>"PASS", is=>"UNSUPPORTED",cat=>$PASS_UNSUPPORTED, report_hwdep=>"false"},
131 {was=>"PASS", is=>"UNTESTED", cat=>$PASS_UNTESTED, report_hwdep=>"true"},
132 {was=>"PASS", is=>"UNRESOLVED",cat=>$PASS_UNRESOLVED, report_hwdep=>"true"},
133 {was=>"PASS", is=>"NO_EXIST", cat=>$PASS_DISAPPEARS, report_hwdep=>"false"},
134 {was=>"NO_EXIST", is=>"PASS", cat=>$PASS_APPEARS, report_hwdep=>"false"},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200135
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000136 {was=>"XPASS", is=>"PASS", cat=>$XPASS_PASS, report_hwdep=>"true"},
137 {was=>"XPASS", is=>"XPASS", cat=>$XPASS_XPASS, report_hwdep=>"true"},
138 {was=>"XPASS", is=>"FAIL", cat=>$XPASS_FAIL, report_hwdep=>"true"},
139 {was=>"XPASS", is=>"XFAIL", cat=>$XPASS_XFAIL, report_hwdep=>"true"},
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000140 {was=>"XPASS", is=>"KFAIL", cat=>$XPASS_KFAIL, report_hwdep=>"true"},
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000141 {was=>"XPASS", is=>"UNSUPPORTED",cat=>$XPASS_UNSUPPORTED, report_hwdep=>"true"},
142 {was=>"XPASS", is=>"UNTESTED", cat=>$XPASS_UNTESTED, report_hwdep=>"true"},
143 {was=>"XPASS", is=>"UNRESOLVED",cat=>$XPASS_UNRESOLVED, report_hwdep=>"true"},
144 {was=>"XPASS", is=>"NO_EXIST", cat=>$XPASS_DISAPPEARS, report_hwdep=>"true"},
145 {was=>"NO_EXIST", is=>"XPASS", cat=>$XPASS_APPEARS, report_hwdep=>"true"},
Christophe Lyonbff39612015-11-18 16:29:11 +0100146
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000147 {was=>"FAIL", is=>"PASS", cat=>$FAIL_PASS, report_hwdep=>"true"},
148 {was=>"FAIL", is=>"XPASS", cat=>$FAIL_XPASS, report_hwdep=>"true"},
149 {was=>"FAIL", is=>"FAIL", cat=>$FAIL_FAIL, report_hwdep=>"true"},
150 {was=>"FAIL", is=>"XFAIL", cat=>$FAIL_XFAIL, report_hwdep=>"true"},
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000151 {was=>"FAIL", is=>"KFAIL", cat=>$FAIL_KFAIL, report_hwdep=>"true"},
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000152 {was=>"FAIL", is=>"UNSUPPORTED",cat=>$FAIL_UNSUPPORTED, report_hwdep=>"true"},
153 {was=>"FAIL", is=>"UNTESTED", cat=>$FAIL_UNTESTED, report_hwdep=>"true"},
154 {was=>"FAIL", is=>"UNRESOLVED",cat=>$FAIL_UNRESOLVED, report_hwdep=>"true"},
155 {was=>"FAIL", is=>"NO_EXIST", cat=>$FAIL_DISAPPEARS, report_hwdep=>"true"},
156 {was=>"NO_EXIST", is=>"FAIL", cat=>$FAIL_APPEARS, report_hwdep=>"true"},
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200157
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000158 {was=>"XFAIL", is=>"PASS", cat=>$XFAIL_PASS, report_hwdep=>"true"},
159 {was=>"XFAIL", is=>"XPASS", cat=>$XFAIL_XPASS, report_hwdep=>"true"},
160 {was=>"XFAIL", is=>"FAIL", cat=>$XFAIL_FAIL, report_hwdep=>"true"},
161 {was=>"XFAIL", is=>"XFAIL", cat=>$XFAIL_XFAIL, report_hwdep=>"true"},
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000162 {was=>"XFAIL", is=>"KFAIL", cat=>$XFAIL_KFAIL, report_hwdep=>"true"},
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000163 {was=>"XFAIL", is=>"UNSUPPORTED",cat=>$XFAIL_UNSUPPORTED, report_hwdep=>"true"},
164 {was=>"XFAIL", is=>"UNTESTED", cat=>$XFAIL_UNTESTED, report_hwdep=>"true"},
165 {was=>"XFAIL", is=>"UNRESOLVED",cat=>$XFAIL_UNRESOLVED, report_hwdep=>"true"},
166 {was=>"XFAIL", is=>"NO_EXIST", cat=>$XFAIL_DISAPPEARS, report_hwdep=>"true"},
167 {was=>"NO_EXIST", is=>"XFAIL", cat=>$XFAIL_APPEARS, report_hwdep=>"true"},
Christophe Lyonbff39612015-11-18 16:29:11 +0100168
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000169 {was=>"KFAIL", is=>"PASS", cat=>$KFAIL_PASS, report_hwdep=>"true"},
170 {was=>"KFAIL", is=>"XPASS", cat=>$KFAIL_XPASS, report_hwdep=>"true"},
171 {was=>"KFAIL", is=>"FAIL", cat=>$KFAIL_FAIL, report_hwdep=>"true"},
172 {was=>"KFAIL", is=>"XFAIL", cat=>$KFAIL_XFAIL, report_hwdep=>"true"},
173 {was=>"KFAIL", is=>"KFAIL", cat=>$KFAIL_KFAIL, report_hwdep=>"true"},
174 {was=>"KFAIL", is=>"UNSUPPORTED",cat=>$KFAIL_UNSUPPORTED, report_hwdep=>"true"},
175 {was=>"KFAIL", is=>"UNTESTED", cat=>$KFAIL_UNTESTED, report_hwdep=>"true"},
176 {was=>"KFAIL", is=>"UNRESOLVED",cat=>$KFAIL_UNRESOLVED, report_hwdep=>"true"},
177 {was=>"KFAIL", is=>"NO_EXIST", cat=>$KFAIL_DISAPPEARS, report_hwdep=>"true"},
178 {was=>"NO_EXIST", is=>"KFAIL", cat=>$KFAIL_APPEARS, report_hwdep=>"true"},
179
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000180 {was=>"UNSUPPORTED", is=>"PASS", cat=>$UNSUPPORTED_PASS, report_hwdep=>"true"},
181 {was=>"UNSUPPORTED", is=>"XPASS", cat=>$UNSUPPORTED_XPASS, report_hwdep=>"true"},
182 {was=>"UNSUPPORTED", is=>"FAIL", cat=>$UNSUPPORTED_FAIL, report_hwdep=>"true"},
183 {was=>"UNSUPPORTED", is=>"XFAIL", cat=>$UNSUPPORTED_XFAIL, report_hwdep=>"true"},
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000184 {was=>"UNSUPPORTED", is=>"KFAIL", cat=>$UNSUPPORTED_KFAIL, report_hwdep=>"true"},
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000185 {was=>"UNSUPPORTED", is=>"UNSUPPORTED",cat=>$UNSUPPORTED_UNSUPPORTED, report_hwdep=>"true"},
186 {was=>"UNSUPPORTED", is=>"UNTESTED", cat=>$UNSUPPORTED_UNTESTED, report_hwdep=>"true"},
187 {was=>"UNSUPPORTED", is=>"UNRESOLVED",cat=>$UNSUPPORTED_UNRESOLVED, report_hwdep=>"true"},
188 {was=>"UNSUPPORTED", is=>"NO_EXIST", cat=>$UNSUPPORTED_DISAPPEARS, report_hwdep=>"true"},
189 {was=>"NO_EXIST", is=>"UNSUPPORTED", cat=>$UNSUPPORTED_APPEARS, report_hwdep=>"true"},
Christophe Lyona140aa82015-12-17 22:53:03 +0100190
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000191 {was=>"UNTESTED", is=>"PASS", cat=>$UNTESTED_PASS, report_hwdep=>"true"},
192 {was=>"UNTESTED", is=>"XPASS", cat=>$UNTESTED_XPASS, report_hwdep=>"true"},
193 {was=>"UNTESTED", is=>"FAIL", cat=>$UNTESTED_FAIL, report_hwdep=>"true"},
194 {was=>"UNTESTED", is=>"XFAIL", cat=>$UNTESTED_XFAIL, report_hwdep=>"true"},
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000195 {was=>"UNTESTED", is=>"KFAIL", cat=>$UNTESTED_KFAIL, report_hwdep=>"true"},
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000196 {was=>"UNTESTED", is=>"UNSUPPORTED",cat=>$UNTESTED_UNSUPPORTED,report_hwdep=>"true"},
197 {was=>"UNTESTED", is=>"UNTESTED", cat=>$UNTESTED_UNTESTED, report_hwdep=>"true"},
198 {was=>"UNTESTED", is=>"UNRESOLVED",cat=>$UNTESTED_UNRESOLVED, report_hwdep=>"true"},
199 {was=>"UNTESTED", is=>"NO_EXIST", cat=>$UNTESTED_DISAPPEARS, report_hwdep=>"true"},
200 {was=>"NO_EXIST", is=>"UNTESTED", cat=>$UNTESTED_APPEARS, report_hwdep=>"true"},
Christophe Lyona140aa82015-12-17 22:53:03 +0100201
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000202 {was=>"UNRESOLVED", is=>"PASS", cat=>$UNRESOLVED_PASS, report_hwdep=>"true"},
203 {was=>"UNRESOLVED", is=>"XPASS", cat=>$UNRESOLVED_XPASS, report_hwdep=>"true"},
204 {was=>"UNRESOLVED", is=>"FAIL", cat=>$UNRESOLVED_FAIL, report_hwdep=>"true"},
205 {was=>"UNRESOLVED", is=>"XFAIL", cat=>$UNRESOLVED_XFAIL, report_hwdep=>"true"},
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000206 {was=>"UNRESOLVED", is=>"KFAIL", cat=>$UNRESOLVED_KFAIL, report_hwdep=>"true"},
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000207 {was=>"UNRESOLVED", is=>"UNSUPPORTED",cat=>$UNRESOLVED_UNSUPPORTED, report_hwdep=>"true"},
208 {was=>"UNRESOLVED", is=>"UNTESTED", cat=>$UNRESOLVED_UNTESTED, report_hwdep=>"true"},
209 {was=>"UNRESOLVED", is=>"UNRESOLVED",cat=>$UNRESOLVED_UNRESOLVED, report_hwdep=>"true"},
210 {was=>"UNRESOLVED", is=>"NO_EXIST", cat=>$UNRESOLVED_DISAPPEARS, report_hwdep=>"true"},
211 {was=>"NO_EXIST", is=>"UNRESOLVED", cat=>$UNRESOLVED_APPEARS, report_hwdep=>"true"},
Christophe Lyondc66fc52016-04-05 17:38:07 +0200212
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000213 {was=>"ERROR", is=>"NO_EXIST", cat=>$ERROR_DISAPPEARS, report_hwdep=>"true"},
214 {was=>"NO_EXIST", is=>"ERROR", cat=>$ERROR_APPEARS, report_hwdep=>"true"},
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200215
Christophe Lyonbff39612015-11-18 16:29:11 +0100216# {was=>"NO_EXIST", is=>"NO_EXIST", handler=>\&handle_not_yet_supported}
217);
218
219######################################################
220# TREAT ARGUMENTS
221
222my $verbose=0;
223my $quiet=0;
224my $long=0;
225my $short=0;
226my $debug=0;
227my ($testroot, $basename);
228my ($ref_file_name, $res_file_name);
229my $nounstable=0;
230my $unstablefile=0;
231my @unstable_markers=();
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000232
233my $no_hwdep=0; # Ignore hw-dependent flag (ie. consider all tests as *not* hw-dependent
234my $hwdep_file=0; # File containing the list of hw-dependent tests
235my @hwdep_markers=(); # Optional markers when parsing hwdep_file
236
Christophe Lyonca9d8302017-05-22 12:04:00 +0000237my $ratio_thresh = 0.95; # Warn if pass ratio is below this threshold
Christophe Lyonbff39612015-11-18 16:29:11 +0100238
239GetOptions ("l" => \$long,
240 "s" => \$short,
241 "q" => \$quiet,
242 "v" => \$verbose,
243 "dbg" => \$debug,
244 "testroot=s" => \$testroot,
245 "basename=s" => \$basename,
Christophe Lyonca9d8302017-05-22 12:04:00 +0000246 "pass-thresh=f" => \$ratio_thresh,
Christophe Lyonbff39612015-11-18 16:29:11 +0100247 "no-unstable" => \$nounstable,
248 "unstable-tests=s" => \$unstablefile,
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000249 "unstable-marker=s" => \@unstable_markers,
250 "no-hwdep" => \$no_hwdep,
251 "hwdep-tests=s" => \$hwdep_file,
252 "hwdep-marker=s" => \@hwdep_markers);
Christophe Lyonbff39612015-11-18 16:29:11 +0100253
254$ref_file_name = $ARGV[0] if ($#ARGV == 1);
255$res_file_name = $ARGV[1] if ($#ARGV == 1);
256
257$ref_file_name = $testroot."/expected_results/".$basename if ($testroot and $basename);
258$res_file_name = $testroot."/testing/run/".$basename if ($testroot and $basename);
259&usage if (not $ref_file_name or not $res_file_name);
260
261my ($col_boldred, $col_red, $col_boldgreen, $col_green, $col_boldpink, $col_pink, $col_reset)
262 = ("\033[31;1m","\033[31;3m","\033[32;1m","\033[32;3m","\033[35;1m","\033[35;2m","\033[0m");
263($col_boldred, $col_red, $col_boldgreen, $col_green, $col_boldpink, $col_pink, $col_reset)
264 = ("","","","","","","") if (not I_am_interactive());
265
266######################################################
267# MAIN PROGRAM
268# print "comparing $ref_file_name $res_file_name\n";
269
270# If none of the 2 .sum exists, nothing to compare: exit early.
271exit 0 if ( (! -e $ref_file_name) && (! -e $res_file_name ));
272
273my $ref = read_sum($ref_file_name) ;
274my $res = read_sum($res_file_name) ;
275my @unstablelist = ();
276
277@unstablelist = read_unstable($unstablefile) if ($unstablefile ne 0);
278
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000279# Import list of hw-dependent files, if provided
280my @hwdep_list = ();
281
282@hwdep_list = read_unstable($hwdep_file) if ($hwdep_file ne 0);
283
Christophe Lyonbff39612015-11-18 16:29:11 +0100284compare_results($ref, $res);
285
286my $final_result = print_compare_results_summary($ref, $res);
287
288exit $final_result;
289
290######################################################
291# UTILITIES
292
293sub empty_result()
294{
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000295 my %empty_result;# = {PASS=>0, FAIL=>0, XPASS=>0, XFAIL=>0, KFAIL=>0, UNSUPPORTED=>0, UNTESTED=>0, UNRESOLVED=>0, ERROR=>0};
296 $empty_result{PASS}=$empty_result{FAIL}=$empty_result{XPASS}=$empty_result{XFAIL}=$empty_result{KFAIL}=0;
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200297 $empty_result{UNSUPPORTED}=$empty_result{UNTESTED}=$empty_result{UNRESOLVED}=$empty_result{NO_EXIST}=$empty_result{ERROR}=0;
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000298 $empty_result{NB}=0;
Christophe Lyonbff39612015-11-18 16:29:11 +0100299 return \%empty_result;
300}
301sub I_am_interactive {
302 return -t STDIN && -t STDOUT;
303}
304sub usage()
305{
306 print "Usage : $app <ref_file.sum> <result_file.sum>\n";
307 exit 1;
308}
309
310
311######################################################
312# PARSING
313sub read_sum($)
314{
315 my ($sum_file) = @_;
316 my $res = empty_result();
317 my %testcases;
318 my %unsupported;
319 $res->{testcases} = \%testcases;
320 my $pending_timeout=0;
Christophe Lyonc63afc92021-07-01 09:52:29 +0000321 my $current_tool="";
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000322 my $current_exp="";
Christophe Lyonbff39612015-11-18 16:29:11 +0100323
Christophe Lyonad8c7242016-02-03 13:04:28 +0100324 $res->{EXEC}->{PASS} = 0;
325 $res->{EXEC}->{FAIL} = 0;
326
Christophe Lyonbff39612015-11-18 16:29:11 +0100327 open SUMFILE, $sum_file or die $!;
328 while (<SUMFILE>)
329 {
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000330 if (m/^(PASS|XPASS|FAIL|XFAIL|KFAIL|UNSUPPORTED|UNTESTED|UNRESOLVED|ERROR): *(.*)/)
Christophe Lyonbff39612015-11-18 16:29:11 +0100331 {
332 my ($diag,$tc) = ($1,$2);
333 my %tcresult;
334 $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 +0000335 # Prefix test name wih .exp filename to help report
336 # regressions/run bisect.
337 $tc = "$current_tool:$current_exp=$tc";
Christophe Lyonbff39612015-11-18 16:29:11 +0100338 $testcases{$tc} = empty_result() if (not exists $testcases{$tc});
339 $testcases{$tc}->{$diag}++;
340 $testcases{$tc}->{HAS_TIMED_OUT} = $pending_timeout;
Christophe Lyonc63afc92021-07-01 09:52:29 +0000341 $testcases{$tc}->{TOOL_EXP} = "$current_tool:$current_exp";
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000342 $testcases{$tc}->{NB}++;
Christophe Lyonbff39612015-11-18 16:29:11 +0100343 $pending_timeout = 0;
344 $res->{$diag}++;
Christophe Lyonad8c7242016-02-03 13:04:28 +0100345 # Count execution tests, for a sanity check
346 if ($tc =~ /execution/)
347 {
348 $res->{EXEC}->{$diag}++;
349 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100350 }
351 elsif (m/WARNING: program timed out/)
352 {
353 $pending_timeout = 1;
354 }
355 elsif (m/^(# of expected passes|# of unexpected failures|# of expected failures|# of known failures|# of unsupported tests|# of untested testcases)\s+(.*)/)
356 {
357 $res->{"summary - "."$1"} = $2;
358 }
359 elsif (m/^\/.*\/([^\/]+)\s+version\s+(.*)/)
360 {
361 $res->{tool} = $1;
362 $res->{version} = $2;
363 $res->{version} =~ s/ [-(].*//;
364 }
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000365 elsif (m/^Running target .*/)
366 {
367 }
368 elsif (m/^Running (.*) \.\.\.*/)
369 {
370 $current_exp=$1;
371 $current_exp =~ s|.*/testsuite/||;
372 }
Christophe Lyonc63afc92021-07-01 09:52:29 +0000373 elsif (m/^\t\t=== (.*) tests ===/)
374 {
375 $current_tool=$1;
376 }
377 elsif (m/^\t\t=== (.*) Summary ===/)
378 {
379 $current_tool="";
380 $current_exp="";
381 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100382 }
383 close SUMFILE;
384 return $res;
385}
386
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000387# Parse list of unstable/hw-dependent tests
Christophe Lyonbff39612015-11-18 16:29:11 +0100388sub read_unstable($)
389{
390 my ($unstable_file) = @_;
391 my @unstable_tests = ();
392
393 open UNSTABLEFILE, $unstable_file or die $!;
394 while (<UNSTABLEFILE>)
395 {
396 # Skip lines starting with '#', or with spaces only
397 if ((/^#/) || (/^[ ]*$/))
398 {
399 }
400 else
401 {
402 chomp;
403
404 my $test = $_;
405
406 # Check if line is of type: target:testname
Christophe Lyon5e7241c2015-12-04 12:57:27 +0100407 if (/^(.*?):/)
Christophe Lyonbff39612015-11-18 16:29:11 +0100408 {
409 foreach my $unstable_marker (@unstable_markers)
410 {
411 if ($unstable_marker eq $1) {
412 # If target matches the one supplied as script
413 # argument, add the testname to the list
Christophe Lyon5e7241c2015-12-04 12:57:27 +0100414 $test =~ s/.*?://;
Christophe Lyonbff39612015-11-18 16:29:11 +0100415 push @unstable_tests, $test;
416 }
417 }
418 } else {
419 push @unstable_tests, $test;
420 }
421 }
422 }
423 close UNSTABLEFILE;
424 return @unstable_tests;
425}
426
427######################################################
428# DIFFING
429sub handle_pass_fail($$$$)
430{
431 my ($ref, $res, $diag_diag, $tc) = @_;
432 if ($res->{testcases}->{$tc}->{HAS_TIMED_OUT})
433 {
434 push @{$res->{$PASSED_NOW_TIMEOUTS}}, $tc;
435 }
436 else
437 {
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000438 # This transition is flagged as hw-dependent if:
439 # - the name is in the list
440 # - the transition should not be reported (but be flagged as hw-dependent instead)
441 # - --no-hwdep was not provided
442 if ((grep { (index $tc,$_)!=-1} @hwdep_list)
443 && ($diag_diag->{report_hwdep} eq "false")
444 && ($no_hwdep == 0)) {
445 push @{$res->{$HWDEP_CASES}}, $tc;
446 } else {
447 push @{$res->{$PASS_FAIL}}, $tc;
448 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100449 }
450}
451
452sub compare_results($$)
453{
454 my ($ref, $res) = @_;
455
Christophe Lyondded4d82016-06-28 18:12:38 +0200456 @{$res->{$PASS_PASS}} = ();
Christophe Lyondded4d82016-06-28 18:12:38 +0200457 @{$res->{$PASS_XPASS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200458 @{$res->{$PASS_FAIL}} = ();
459 @{$res->{$PASS_XFAIL}} = ();
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000460 @{$res->{$PASS_KFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200461 @{$res->{$PASS_UNSUPPORTED}} = ();
462 @{$res->{$PASS_UNTESTED}} = ();
463 @{$res->{$PASS_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200464 @{$res->{$PASS_DISAPPEARS}} = ();
465 @{$res->{$PASS_APPEARS}} = ();
466 @{$res->{$PASSED_NOW_TIMEOUTS}} = ();
467
Christophe Lyondded4d82016-06-28 18:12:38 +0200468 @{$res->{$XPASS_PASS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200469 @{$res->{$XPASS_XPASS}} = ();
470 @{$res->{$XPASS_FAIL}} = ();
471 @{$res->{$XPASS_XFAIL}} = ();
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000472 @{$res->{$XPASS_KFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200473 @{$res->{$XPASS_UNSUPPORTED}} = ();
474 @{$res->{$XPASS_UNTESTED}} = ();
475 @{$res->{$XPASS_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200476 @{$res->{$XPASS_DISAPPEARS}} = ();
477 @{$res->{$XPASS_APPEARS}} = ();
478
479 @{$res->{$FAIL_PASS}} = ();
480 @{$res->{$FAIL_XPASS}} = ();
481 @{$res->{$FAIL_FAIL}} = ();
482 @{$res->{$FAIL_XFAIL}} = ();
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000483 @{$res->{$FAIL_KFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200484 @{$res->{$FAIL_UNSUPPORTED}} = ();
485 @{$res->{$FAIL_UNTESTED}} = ();
486 @{$res->{$FAIL_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200487 @{$res->{$FAIL_DISAPPEARS}} = ();
488 @{$res->{$FAIL_APPEARS}} = ();
489
Christophe Lyondded4d82016-06-28 18:12:38 +0200490 @{$res->{$XFAIL_PASS}} = ();
491 @{$res->{$XFAIL_XPASS}} = ();
492 @{$res->{$XFAIL_FAIL}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200493 @{$res->{$XFAIL_XFAIL}} = ();
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000494 @{$res->{$XFAIL_KFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200495 @{$res->{$XFAIL_UNSUPPORTED}} = ();
496 @{$res->{$XFAIL_UNTESTED}} = ();
497 @{$res->{$XFAIL_UNRESOLVED}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200498 @{$res->{$XFAIL_DISAPPEARS}} = ();
499 @{$res->{$XFAIL_APPEARS}} = ();
500
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000501 @{$res->{$KFAIL_PASS}} = ();
502 @{$res->{$KFAIL_XPASS}} = ();
503 @{$res->{$KFAIL_FAIL}} = ();
504 @{$res->{$KFAIL_XFAIL}} = ();
505 @{$res->{$KFAIL_KFAIL}} = ();
506 @{$res->{$KFAIL_UNSUPPORTED}} = ();
507 @{$res->{$KFAIL_UNTESTED}} = ();
508 @{$res->{$KFAIL_UNRESOLVED}} = ();
509 @{$res->{$KFAIL_DISAPPEARS}} = ();
510 @{$res->{$KFAIL_APPEARS}} = ();
511
Christophe Lyona140aa82015-12-17 22:53:03 +0100512 @{$res->{$UNSUPPORTED_PASS}} = ();
513 @{$res->{$UNSUPPORTED_XPASS}} = ();
514 @{$res->{$UNSUPPORTED_FAIL}} = ();
515 @{$res->{$UNSUPPORTED_XFAIL}} = ();
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000516 @{$res->{$UNSUPPORTED_KFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200517 @{$res->{$UNSUPPORTED_UNSUPPORTED}} = ();
518 @{$res->{$UNSUPPORTED_UNTESTED}} = ();
519 @{$res->{$UNSUPPORTED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100520 @{$res->{$UNSUPPORTED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200521 @{$res->{$UNSUPPORTED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200522
Christophe Lyona140aa82015-12-17 22:53:03 +0100523 @{$res->{$UNTESTED_PASS}} = ();
524 @{$res->{$UNTESTED_XPASS}} = ();
525 @{$res->{$UNTESTED_FAIL}} = ();
526 @{$res->{$UNTESTED_XFAIL}} = ();
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000527 @{$res->{$UNTESTED_KFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200528 @{$res->{$UNTESTED_UNSUPPORTED}} = ();
529 @{$res->{$UNTESTED_UNTESTED}} = ();
530 @{$res->{$UNTESTED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100531 @{$res->{$UNTESTED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200532 @{$res->{$UNTESTED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200533
Christophe Lyona140aa82015-12-17 22:53:03 +0100534 @{$res->{$UNRESOLVED_PASS}} = ();
535 @{$res->{$UNRESOLVED_XPASS}} = ();
536 @{$res->{$UNRESOLVED_FAIL}} = ();
537 @{$res->{$UNRESOLVED_XFAIL}} = ();
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000538 @{$res->{$UNRESOLVED_KFAIL}} = ();
Christophe Lyon9dde3332016-06-28 23:00:00 +0200539 @{$res->{$UNRESOLVED_UNSUPPORTED}} = ();
540 @{$res->{$UNRESOLVED_UNTESTED}} = ();
541 @{$res->{$UNRESOLVED_UNRESOLVED}} = ();
Christophe Lyona140aa82015-12-17 22:53:03 +0100542 @{$res->{$UNRESOLVED_DISAPPEARS}} = ();
Christophe Lyondc66fc52016-04-05 17:38:07 +0200543 @{$res->{$UNRESOLVED_APPEARS}} = ();
Christophe Lyonfdfbd172016-06-28 18:38:55 +0200544
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200545 @{$res->{$ERROR_DISAPPEARS}} = ();
546 @{$res->{$ERROR_APPEARS}} = ();
547
Christophe Lyonbff39612015-11-18 16:29:11 +0100548 @{$res->{$UNHANDLED_CASES}} = ();
549 @{$res->{$UNSTABLE_CASES}} = ();
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000550 @{$res->{$HWDEP_CASES}} = ();
Christophe Lyonbff39612015-11-18 16:29:11 +0100551
552 #### MERGE REF AND RES
553 foreach my $key (sort (keys %{$res->{testcases}}))
554 {
555 if (not exists $ref->{testcases}->{$key}) {
556 $ref->{testcases}->{$key} = empty_result();
557 $ref->{testcases}->{$key}->{NO_EXIST} = 1;
Christophe Lyonc63afc92021-07-01 09:52:29 +0000558 $ref->{testcases}->{$key}->{TOOL_EXP} = $res->{testcases}->{$key}->{TOOL_EXP};
Christophe Lyonbff39612015-11-18 16:29:11 +0100559 }
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000560
561 # Consistency check, useful in case of duplicate test names
562 if ($ref->{testcases}->{$key}->{NB} != $res->{testcases}->{$key}->{NB}) {
563 print "Number of occurrences mismatch $key (ref $ref->{testcases}->{$key}->{NB} vs $res->{testcases}->{$key}->{NB})\n" if ($debug);
564 if ($ref->{testcases}->{$key}->{NB} > $res->{testcases}->{$key}->{NB}) {
565 $res->{testcases}->{$key}->{NO_EXIST} = 1;
566 } elsif ($ref->{testcases}->{$key}->{NB} < $res->{testcases}->{$key}->{NB}) {
567 $ref->{testcases}->{$key}->{NO_EXIST} = 1;
568 }
569 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100570 }
571 foreach my $key (keys %{$ref->{testcases}})
572 {
573 if (not exists $res->{testcases}->{$key})
574 {
575 $res->{testcases}->{$key} = empty_result();
576 $res->{testcases}->{$key}->{NO_EXIST} = 1;
Christophe Lyonc63afc92021-07-01 09:52:29 +0000577 $res->{testcases}->{$key}->{TOOL_EXP} = $ref->{testcases}->{$key}->{TOOL_EXP};
Christophe Lyonbff39612015-11-18 16:29:11 +0100578 }
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000579
580 # No need for similar consistency check: since we are
581 # checking for tests whose number of occurrences are
582 # different, they are present in both ref and res, so
583 # no need to check again here.
Christophe Lyonbff39612015-11-18 16:29:11 +0100584 }
585
586 #### ACTIONS FOR EACH CASES
587 my %unstable_found;
588
589 foreach my $key (sort (keys %{$ref->{testcases}}))
590 {
591 foreach my $diag_diag (@handler_list)
592 {
593 if ($ref->{testcases}->{$key}->{$diag_diag->{was}} != $res->{testcases}->{$key}->{$diag_diag->{was}}
Christophe Lyon9a3ce972021-06-30 23:18:23 +0000594 and $ref->{testcases}->{$key}->{$diag_diag->{was}}
Christophe Lyonbff39612015-11-18 16:29:11 +0100595 and $res->{testcases}->{$key}->{$diag_diag->{is}})
596 {
Christophe Lyon1ed93102021-06-30 23:04:43 +0000597 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 +0000598 # If testcase is listed as 'unstable' mark it as such
599 # and skip other processing to avoid listing it twice.
Christophe Lyonbff39612015-11-18 16:29:11 +0100600 {
601 if (grep { (index $key,$_)!=-1} @unstablelist)
602 {
603 print "[unstable] $key\n" if ($debug);
604 $unstable_found{$key}=1;
605 }
606 else {
607 print "[$diag_diag->{was} => $diag_diag->{is}] $key\n" if ($debug);
608 if ($diag_diag->{handler})
609 {
610 $diag_diag->{handler} ($ref, $res, $diag_diag, $key);
611 }
612 else
613 {
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000614 # This transition is flagged as hw-dependent if:
615 # - the name is in the list
616 # - the transition should not be reported (but be flagged as hw-dependent instead)
617 # - --no-hwdep was not provided
618 if ((grep { (index $key,$_)!=-1} @hwdep_list)
619 && ($diag_diag->{report_hwdep} eq "false")
620 && ($no_hwdep == 0)) {
621 push @{$res->{$HWDEP_CASES}}, $key;
622 } else {
623 push @{$res->{$diag_diag->{cat}}}, $key;
624 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100625 }
626 }
627 }
628 }
629 }
630 }
631 push @{$res->{$UNSTABLE_CASES}}, (sort (keys (%unstable_found))) if ($nounstable == 0);
632
633}
634
635######################################################
636# PRINTING
637sub print_tclist($@)
638{
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000639 # The 1st parameter is used to find the name of the .exp file
Christophe Lyon28a92782017-09-13 09:00:39 +0000640 # associated with the testcase.
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000641 my ($this_res, $cat, @tclist) = @_;
Christophe Lyonc63afc92021-07-01 09:52:29 +0000642 my $this_tool_exp = "";
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000643 if (scalar(@tclist))
644 {
645 print " - ".$cat.":\n\n";
646 foreach my $case (@tclist)
647 {
Christophe Lyonc63afc92021-07-01 09:52:29 +0000648 if ($this_tool_exp ne $this_res->{testcases}->{$case}->{TOOL_EXP}) {
649 $this_tool_exp = $this_res->{testcases}->{$case}->{TOOL_EXP};
650 print " Executed from: $this_tool_exp\n";
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000651 }
652 print " $case\n";
653 }
654 print "\n\n";
655 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100656}
657
658sub print_compare_results_summary($$)
659{
660 my ($ref, $res) = @_;
661 my $return_value=0;
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100662 my $total_better = 0;
Christophe Lyonbff39612015-11-18 16:29:11 +0100663 my $rtotal = 0;
664 my $quiet_reg = $quiet;
Christophe Lyond618f662016-02-02 19:07:58 +0100665 my $ref_ratio = 0;
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200666 my $ref_total = 0;
Christophe Lyond618f662016-02-02 19:07:58 +0100667 my $res_ratio = 0;
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200668 my $res_total = 0;
Christophe Lyonad8c7242016-02-03 13:04:28 +0100669 my $ignore_exec = 0;
670 my $ref_has_exec_tests = 0;
671 my $res_has_exec_tests = 0;
Christophe Lyond618f662016-02-02 19:07:58 +0100672
673 # Compute the pass ratio as a sanity check
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200674 $ref_total = $ref->{PASS} +
675 $ref->{XFAIL} +
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000676 $ref->{KFAIL} +
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200677 $ref->{XPASS} +
678 $ref->{FAIL} +
679 $ref->{UNRESOLVED} +
680 $ref->{UNSUPPORTED} +
681 $ref->{UNTESTED};
682
683 # It is possible that no test is executed at all (for instance if
684 # RUNTESTFLAGS was too restrictive). Avoid division by 0.
685 if ($ref_total > 0) {
686 $ref_ratio = ($ref->{PASS} + $ref->{XFAIL}) /
687 $ref_total;
688 }
689
690 $res_total = $res->{PASS} +
691 $res->{XFAIL} +
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000692 $res->{KFAIL} +
Christophe Lyon0ab7d352016-04-06 10:39:58 +0200693 $res->{XPASS} +
694 $res->{FAIL} +
695 $res->{UNRESOLVED} +
696 $res->{UNSUPPORTED} +
697 $res->{UNTESTED};
698
699 if ($res_total > 0) {
700 $res_ratio = ($res->{PASS} + $res->{XFAIL}) /
701 $res_total;
702 }
Christophe Lyonbff39612015-11-18 16:29:11 +0100703
704 if (not $quiet)
705 {
706 printf "Comparing:\n";
707 printf "REFERENCE:$ref_file_name\n";
708 printf "CURRENT: $res_file_name\n\n";
709 }
710
711 #### TESTS STATUS
712 if (not $quiet and not $short)
713 {
Thiago Jung Bauermann66d0ccb2023-03-01 05:15:40 +0000714 printf " +---------+---------+\n";
Christophe Lyona140aa82015-12-17 22:53:03 +0100715 printf "o RUN STATUS: | REF | RES |\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100716 printf " +------------------------------------------+---------+---------+\n";
Christophe Lyona140aa82015-12-17 22:53:03 +0100717 printf " | %-40s | %7d | %7d |\n", "Passes [PASS]", $ref->{PASS}, $res->{PASS};
Christophe Lyonbff39612015-11-18 16:29:11 +0100718 printf " | %-40s | %7d | %7d |\n", "Unexpected fails [FAIL]", $ref->{FAIL}, $res->{FAIL};
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200719 printf " | %-40s | %7d | %7d |\n", "Errors [ERROR]", $ref->{ERROR}, $res->{ERROR};
Christophe Lyona140aa82015-12-17 22:53:03 +0100720 printf " | %-40s | %7d | %7d |\n", "Unexpected passes [XPASS]", $ref->{XPASS}, $res->{XPASS};
Christophe Lyonbff39612015-11-18 16:29:11 +0100721 printf " | %-40s | %7d | %7d |\n", "Expected fails [XFAIL]", $ref->{XFAIL}, $res->{XFAIL};
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000722 printf " | %-40s | %7d | %7d |\n", "Known fails [KFAIL]", $ref->{KFAIL}, $res->{KFAIL};
Christophe Lyonbff39612015-11-18 16:29:11 +0100723 printf " | %-40s | %7d | %7d |\n", "Unresolved [UNRESOLVED]", $ref->{UNRESOLVED}, $res->{UNRESOLVED};
Christophe Lyona140aa82015-12-17 22:53:03 +0100724 printf " | %-40s | %7d | %7d |\n", "Unsupported [UNSUPPORTED]", $ref->{UNSUPPORTED}, $res->{UNSUPPORTED};
725 printf " | %-40s | %7d | %7d |\n", "Untested [UNTESTED]", $ref->{UNTESTED}, $res->{UNTESTED};
Christophe Lyonbff39612015-11-18 16:29:11 +0100726 printf " +------------------------------------------+---------+---------+\n";
727 printf "\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100728
Christophe Lyon3d195c22016-04-06 16:00:25 +0200729 printf " REF PASS ratio: %f\n", $ref_ratio;
730 printf " RES PASS ratio: %f\n", $res_ratio;
Christophe Lyond618f662016-02-02 19:07:58 +0100731 if ($ref_ratio < $ratio_thresh)
732 {
Christophe Lyon1176f962016-03-03 18:01:10 +0100733 printf " ***** ERROR: REF PASS ratio is abnormally low *****\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100734 }
735 if ($res_ratio < $ratio_thresh)
736 {
Christophe Lyon1176f962016-03-03 18:01:10 +0100737 printf " ***** ERROR: RES PASS ratio is abnormally low *****\n";
Christophe Lyond618f662016-02-02 19:07:58 +0100738 }
739
Christophe Lyonad8c7242016-02-03 13:04:28 +0100740 # If both PASS and FAIL EXEC tests are zero, assume there is no
741 # execution test for this tool, and do not warn.
742 $ref_has_exec_tests = ($ref->{EXEC}->{PASS} + $ref->{EXEC}->{FAIL}) != 0;
743 if ($ref_has_exec_tests)
744 {
745 printf " ***** ERROR: No REF execution test PASSed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{PASS} == 0);
746 printf " ***** WARNING: No REF execution test FAILed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{FAIL} == 0);
747 }
748
749 $res_has_exec_tests = ($res->{EXEC}->{PASS} + $res->{EXEC}->{FAIL}) != 0;
750 if ($res_has_exec_tests)
751 {
752 printf " ***** ERROR: No RES execution test PASSed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{PASS} == 0);
753 printf " ***** WARNING: No RES execution test FAILed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{FAIL} == 0);
754 }
755
756 # Ignore number of execution tests when computing the return
757 # value, if both REF and RES have no execution test.
758 $ignore_exec = !$ref_has_exec_tests && !$res_has_exec_tests;
Christophe Lyonbff39612015-11-18 16:29:11 +0100759 }
760
761 #### REGRESSIONS ?
Christophe Lyon9dde3332016-06-28 23:00:00 +0200762 $rtotal = scalar(@{$res->{$PASS_XPASS}})
763 +scalar(@{$res->{$PASS_FAIL}})
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000764 +scalar(@{$res->{$PASS_KFAIL}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200765 +scalar(@{$res->{$PASS_UNRESOLVED}})
766 +scalar(@{$res->{$PASSED_NOW_TIMEOUTS}})
Christophe Lyon30037832018-11-30 15:33:20 +0000767 +scalar(@{$res->{$ERROR_APPEARS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200768 +scalar(@{$res->{$XPASS_FAIL}})
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000769 +scalar(@{$res->{$XPASS_KFAIL}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100770 +scalar(@{$res->{$XPASS_APPEARS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200771 +scalar(@{$res->{$XPASS_UNRESOLVED}})
772 +scalar(@{$res->{$FAIL_APPEARS}})
773 +scalar(@{$res->{$FAIL_UNRESOLVED}})
Christophe Lyondded4d82016-06-28 18:12:38 +0200774 +scalar(@{$res->{$XFAIL_FAIL}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200775 +scalar(@{$res->{$XFAIL_UNRESOLVED}})
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000776 +scalar(@{$res->{$KFAIL_APPEARS}})
777 +scalar(@{$res->{$KFAIL_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100778 +scalar(@{$res->{$UNSUPPORTED_FAIL}})
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000779 +scalar(@{$res->{$UNSUPPORTED_KFAIL}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100780 +scalar(@{$res->{$UNSUPPORTED_XPASS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200781 +scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100782 +scalar(@{$res->{$UNTESTED_FAIL}})
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000783 +scalar(@{$res->{$UNTESTED_KFAIL}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100784 +scalar(@{$res->{$UNTESTED_XPASS}})
Christophe Lyon9dde3332016-06-28 23:00:00 +0200785 +scalar(@{$res->{$UNTESTED_UNRESOLVED}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100786 +scalar(@{$res->{$UNRESOLVED_FAIL}})
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000787 +scalar(@{$res->{$UNRESOLVED_KFAIL}})
Christophe Lyona140aa82015-12-17 22:53:03 +0100788 +scalar(@{$res->{$UNRESOLVED_XPASS}})
Christophe Lyon30037832018-11-30 15:33:20 +0000789 +scalar(@{$res->{$UNRESOLVED_APPEARS}});
Christophe Lyona140aa82015-12-17 22:53:03 +0100790
791 $quiet_reg=1 if ($short and not $rtotal);
Christophe Lyonbff39612015-11-18 16:29:11 +0100792
793 if (not $quiet_reg)
794 {
Christophe Lyona140aa82015-12-17 22:53:03 +0100795 printf "\n$col_red"."o REGRESSIONS:\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100796 printf " +------------------------------------------+---------+\n";
Christophe Lyondded4d82016-06-28 18:12:38 +0200797 printf " | %-40s | %7d |\n", $PASS_XPASS, scalar(@{$res->{$PASS_XPASS}}) if (scalar(@{$res->{$PASS_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200798 printf " | %-40s | %7d |\n", $PASS_FAIL, scalar(@{$res->{$PASS_FAIL}}) if (scalar(@{$res->{$PASS_FAIL}}));
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000799 printf " | %-40s | %7d |\n", $PASS_KFAIL, scalar(@{$res->{$PASS_KFAIL}}) if (scalar(@{$res->{$PASS_KFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200800 printf " | %-40s | %7d |\n", $PASS_UNRESOLVED, scalar(@{$res->{$PASS_UNRESOLVED}}) if (scalar(@{$res->{$PASS_UNRESOLVED}}));
801 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 +0200802 printf " | %-40s | %7d |\n", $ERROR_APPEARS, scalar(@{$res->{$ERROR_APPEARS}}) if (scalar(@{$res->{$ERROR_APPEARS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200803 printf " | %-40s | %7d |\n", $XPASS_FAIL, scalar(@{$res->{$XPASS_FAIL}}) if (scalar(@{$res->{$XPASS_FAIL}}));
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000804 printf " | %-40s | %7d |\n", $XPASS_KFAIL, scalar(@{$res->{$XPASS_KFAIL}}) if (scalar(@{$res->{$XPASS_KFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200805 printf " | %-40s | %7d |\n", $XPASS_APPEARS, scalar(@{$res->{$XPASS_APPEARS}}) if (scalar(@{$res->{$XPASS_APPEARS}}));
806 printf " | %-40s | %7d |\n", $XPASS_UNRESOLVED, scalar(@{$res->{$XPASS_UNRESOLVED}}) if (scalar(@{$res->{$XPASS_UNRESOLVED}}));
807 printf " | %-40s | %7d |\n", $FAIL_APPEARS, scalar(@{$res->{$FAIL_APPEARS}}) if (scalar(@{$res->{$FAIL_APPEARS}}));
808 printf " | %-40s | %7d |\n", $FAIL_UNRESOLVED, scalar(@{$res->{$FAIL_UNRESOLVED}}) if (scalar(@{$res->{$FAIL_UNRESOLVED}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200809 printf " | %-40s | %7d |\n", $XFAIL_FAIL, scalar(@{$res->{$XFAIL_FAIL}}) if (scalar(@{$res->{$XFAIL_FAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200810 printf " | %-40s | %7d |\n", $XFAIL_UNRESOLVED, scalar(@{$res->{$XFAIL_UNRESOLVED}}) if (scalar(@{$res->{$XFAIL_UNRESOLVED}}));
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000811 printf " | %-40s | %7d |\n", $KFAIL_APPEARS, scalar(@{$res->{$KFAIL_APPEARS}}) if (scalar(@{$res->{$KFAIL_APPEARS}}));
812 printf " | %-40s | %7d |\n", $KFAIL_UNRESOLVED, scalar(@{$res->{$KFAIL_UNRESOLVED}}) if (scalar(@{$res->{$KFAIL_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100813 printf " | %-40s | %7d |\n", $UNSUPPORTED_FAIL, scalar(@{$res->{$UNSUPPORTED_FAIL}}) if (scalar(@{$res->{$UNSUPPORTED_FAIL}}));
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000814 printf " | %-40s | %7d |\n", $UNSUPPORTED_KFAIL, scalar(@{$res->{$UNSUPPORTED_KFAIL}}) if (scalar(@{$res->{$UNSUPPORTED_KFAIL}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100815 printf " | %-40s | %7d |\n", $UNSUPPORTED_XPASS, scalar(@{$res->{$UNSUPPORTED_XPASS}}) if (scalar(@{$res->{$UNSUPPORTED_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200816 printf " | %-40s | %7d |\n", $UNSUPPORTED_UNRESOLVED, scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}) if (scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100817 printf " | %-40s | %7d |\n", $UNTESTED_FAIL, scalar(@{$res->{$UNTESTED_FAIL}}) if (scalar(@{$res->{$UNTESTED_FAIL}}));
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000818 printf " | %-40s | %7d |\n", $UNTESTED_KFAIL, scalar(@{$res->{$UNTESTED_KFAIL}}) if (scalar(@{$res->{$UNTESTED_KFAIL}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100819 printf " | %-40s | %7d |\n", $UNTESTED_XPASS, scalar(@{$res->{$UNTESTED_XPASS}}) if (scalar(@{$res->{$UNTESTED_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200820 printf " | %-40s | %7d |\n", $UNTESTED_UNRESOLVED, scalar(@{$res->{$UNTESTED_UNRESOLVED}}) if (scalar(@{$res->{$UNTESTED_UNRESOLVED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100821 printf " | %-40s | %7d |\n", $UNRESOLVED_FAIL, scalar(@{$res->{$UNRESOLVED_FAIL}}) if (scalar(@{$res->{$UNRESOLVED_FAIL}}));
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000822 printf " | %-40s | %7d |\n", $UNRESOLVED_KFAIL, scalar(@{$res->{$UNRESOLVED_KFAIL}}) if (scalar(@{$res->{$UNRESOLVED_KFAIL}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100823 printf " | %-40s | %7d |\n", $UNRESOLVED_XPASS, scalar(@{$res->{$UNRESOLVED_XPASS}}) if (scalar(@{$res->{$UNRESOLVED_XPASS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200824 printf " | %-40s | %7d |\n", $UNRESOLVED_APPEARS, scalar(@{$res->{$UNRESOLVED_APPEARS}}) if (scalar(@{$res->{$UNRESOLVED_APPEARS}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100825 printf " +------------------------------------------+---------+\n";
826 printf " | %-40s | %7d |\n", "TOTAL_REGRESSIONS", $rtotal;
827 printf " +------------------------------------------+---------+\n";
828 printf "\n";
829
830 if ($long)
831 {
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000832 print_tclist($res, $PASS_XPASS, @{$res->{$PASS_XPASS}});
833 print_tclist($res, $PASS_FAIL, @{$res->{$PASS_FAIL}});
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000834 print_tclist($res, $PASS_KFAIL, @{$res->{$PASS_KFAIL}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000835 print_tclist($res, $PASS_UNRESOLVED, @{$res->{$PASS_UNRESOLVED}});
836 print_tclist($res, $PASSED_NOW_TIMEOUTS, @{$res->{$PASSED_NOW_TIMEOUTS}});
837 print_tclist($res, $ERROR_APPEARS, @{$res->{$ERROR_APPEARS}});
838 print_tclist($res, $XPASS_FAIL, @{$res->{$XPASS_FAIL}});
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000839 print_tclist($res, $XPASS_KFAIL, @{$res->{$XPASS_KFAIL}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000840 print_tclist($res, $XPASS_APPEARS, @{$res->{$XPASS_APPEARS}});
841 print_tclist($res, $XPASS_UNRESOLVED, @{$res->{$XPASS_UNRESOLVED}});
842 print_tclist($res, $FAIL_APPEARS, @{$res->{$FAIL_APPEARS}});
843 print_tclist($res, $FAIL_UNRESOLVED, @{$res->{$FAIL_UNRESOLVED}});
844 print_tclist($res, $XFAIL_FAIL, @{$res->{$XFAIL_FAIL}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000845 print_tclist($res, $XFAIL_UNRESOLVED, @{$res->{$XFAIL_UNRESOLVED}});
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000846 print_tclist($res, $KFAIL_APPEARS, @{$res->{$KFAIL_APPEARS}});
847 print_tclist($res, $KFAIL_UNRESOLVED, @{$res->{$KFAIL_UNRESOLVED}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000848 print_tclist($res, $UNSUPPORTED_FAIL, @{$res->{$UNSUPPORTED_FAIL}});
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000849 print_tclist($res, $UNSUPPORTED_KFAIL, @{$res->{$UNSUPPORTED_KFAIL}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000850 print_tclist($res, $UNSUPPORTED_XPASS, @{$res->{$UNSUPPORTED_XPASS}});
851 print_tclist($res, $UNSUPPORTED_UNRESOLVED, @{$res->{$UNSUPPORTED_UNRESOLVED}});
852 print_tclist($res, $UNTESTED_FAIL, @{$res->{$UNTESTED_FAIL}});
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000853 print_tclist($res, $UNTESTED_KFAIL, @{$res->{$UNTESTED_KFAIL}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000854 print_tclist($res, $UNTESTED_XPASS, @{$res->{$UNTESTED_XPASS}});
855 print_tclist($res, $UNTESTED_UNRESOLVED, @{$res->{$UNTESTED_UNRESOLVED}});
856 print_tclist($res, $UNRESOLVED_FAIL, @{$res->{$UNRESOLVED_FAIL}});
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000857 print_tclist($res, $UNRESOLVED_KFAIL, @{$res->{$UNRESOLVED_KFAIL}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000858 print_tclist($res, $UNRESOLVED_XPASS, @{$res->{$UNRESOLVED_XPASS}});
859 print_tclist($res, $UNRESOLVED_APPEARS, @{$res->{$UNRESOLVED_APPEARS}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100860 }
861 printf "$col_reset\n";
862 }
863
Christophe Lyon924cce42018-11-30 15:38:19 +0000864 #### IMPROVEMENTS TO BE CHECKED ?
Christophe Lyonbff39612015-11-18 16:29:11 +0100865 if (not $quiet and not $short)
866 {
Christophe Lyon9dde3332016-06-28 23:00:00 +0200867 $total_better =
Christophe Lyon31279df2016-07-04 17:02:12 +0200868 scalar(@{$res->{$PASS_DISAPPEARS}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200869 scalar(@{$res->{$PASS_XFAIL}})+
870 scalar(@{$res->{$PASS_APPEARS}})+
871 scalar(@{$res->{$PASS_UNSUPPORTED}})+
872 scalar(@{$res->{$PASS_UNTESTED}})+
873 scalar(@{$res->{$XPASS_PASS}})+
874 scalar(@{$res->{$XPASS_XFAIL}})+
875 scalar(@{$res->{$XPASS_UNSUPPORTED}})+
876 scalar(@{$res->{$XPASS_UNTESTED}})+
877 scalar(@{$res->{$XPASS_DISAPPEARS}})+
Christophe Lyondded4d82016-06-28 18:12:38 +0200878 scalar(@{$res->{$FAIL_PASS}})+
879 scalar(@{$res->{$FAIL_XPASS}})+
Christophe Lyondded4d82016-06-28 18:12:38 +0200880 scalar(@{$res->{$FAIL_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200881 scalar(@{$res->{$FAIL_UNSUPPORTED}})+
882 scalar(@{$res->{$FAIL_UNTESTED}})+
883 scalar(@{$res->{$FAIL_DISAPPEARS}})+
Christophe Lyon3b675e82018-11-30 15:24:32 +0000884 scalar(@{$res->{$XFAIL_DISAPPEARS}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200885 scalar(@{$res->{$XFAIL_PASS}})+
886 scalar(@{$res->{$XFAIL_XPASS}})+
887 scalar(@{$res->{$XFAIL_UNSUPPORTED}})+
888 scalar(@{$res->{$XFAIL_UNTESTED}})+
889 scalar(@{$res->{$XFAIL_APPEARS}})+
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000890 scalar(@{$res->{$KFAIL_PASS}})+
891 scalar(@{$res->{$KFAIL_XPASS}})+
892 scalar(@{$res->{$KFAIL_XFAIL}})+
893 scalar(@{$res->{$KFAIL_UNSUPPORTED}})+
894 scalar(@{$res->{$KFAIL_UNTESTED}})+
895 scalar(@{$res->{$KFAIL_DISAPPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100896 scalar(@{$res->{$UNSUPPORTED_PASS}})+
897 scalar(@{$res->{$UNSUPPORTED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200898 scalar(@{$res->{$UNSUPPORTED_UNTESTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100899 scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}})+
Christophe Lyondc66fc52016-04-05 17:38:07 +0200900 scalar(@{$res->{$UNSUPPORTED_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100901 scalar(@{$res->{$UNTESTED_PASS}})+
902 scalar(@{$res->{$UNTESTED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200903 scalar(@{$res->{$UNTESTED_UNSUPPORTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100904 scalar(@{$res->{$UNTESTED_DISAPPEARS}})+
Christophe Lyondc66fc52016-04-05 17:38:07 +0200905 scalar(@{$res->{$UNTESTED_APPEARS}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100906 scalar(@{$res->{$UNRESOLVED_PASS}})+
907 scalar(@{$res->{$UNRESOLVED_XFAIL}})+
Christophe Lyon9dde3332016-06-28 23:00:00 +0200908 scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}})+
909 scalar(@{$res->{$UNRESOLVED_UNTESTED}})+
Christophe Lyona140aa82015-12-17 22:53:03 +0100910 scalar(@{$res->{$UNRESOLVED_DISAPPEARS}})+
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200911 scalar(@{$res->{$ERROR_DISAPPEARS}})+
Christophe Lyonf5aeb342015-12-08 14:47:16 +0100912 scalar(@{$res->{$UNHANDLED_CASES}});
Christophe Lyonbff39612015-11-18 16:29:11 +0100913
Christophe Lyon924cce42018-11-30 15:38:19 +0000914 printf "$col_pink"."o IMPROVEMENTS TO BE CHECKED:\n";
Christophe Lyonbff39612015-11-18 16:29:11 +0100915 printf " +------------------------------------------+---------+\n";
Christophe Lyon31279df2016-07-04 17:02:12 +0200916 printf " | %-40s | %7d |\n", $PASS_DISAPPEARS, scalar(@{$res->{$PASS_DISAPPEARS}}) if (scalar(@{$res->{$PASS_DISAPPEARS}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200917 printf " | %-40s | %7d |\n", $PASS_XFAIL, scalar(@{$res->{$PASS_XFAIL}}) if (scalar(@{$res->{$PASS_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200918 printf " | %-40s | %7d |\n", $PASS_APPEARS, scalar(@{$res->{$PASS_APPEARS}}) if (scalar(@{$res->{$PASS_APPEARS}}));
919 printf " | %-40s | %7d |\n", $PASS_UNSUPPORTED, scalar(@{$res->{$PASS_UNSUPPORTED}}) if (scalar(@{$res->{$PASS_UNSUPPORTED}}));
920 printf " | %-40s | %7d |\n", $PASS_UNTESTED, scalar(@{$res->{$PASS_UNTESTED}}) if (scalar(@{$res->{$PASS_UNTESTED}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200921 printf " | %-40s | %7d |\n", $XPASS_PASS, scalar(@{$res->{$XPASS_PASS}}) if (scalar(@{$res->{$XPASS_PASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200922 printf " | %-40s | %7d |\n", $XPASS_XFAIL, scalar(@{$res->{$XPASS_XFAIL}}) if (scalar(@{$res->{$XPASS_XFAIL}}));
923 printf " | %-40s | %7d |\n", $XPASS_UNSUPPORTED, scalar(@{$res->{$XPASS_UNSUPPORTED}}) if (scalar(@{$res->{$XPASS_UNSUPPORTED}}));
924 printf " | %-40s | %7d |\n", $XPASS_UNTESTED, scalar(@{$res->{$XPASS_UNTESTED}}) if (scalar(@{$res->{$XPASS_UNTESTED}}));
925 printf " | %-40s | %7d |\n", $XPASS_DISAPPEARS, scalar(@{$res->{$XPASS_DISAPPEARS}}) if (scalar(@{$res->{$XPASS_DISAPPEARS}}));
Christophe Lyondded4d82016-06-28 18:12:38 +0200926 printf " | %-40s | %7d |\n", $FAIL_PASS, scalar(@{$res->{$FAIL_PASS}}) if (scalar(@{$res->{$FAIL_PASS}}));
927 printf " | %-40s | %7d |\n", $FAIL_XPASS, scalar(@{$res->{$FAIL_XPASS}}) if (scalar(@{$res->{$FAIL_XPASS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200928 printf " | %-40s | %7d |\n", $FAIL_XFAIL, scalar(@{$res->{$FAIL_XFAIL}}) if (scalar(@{$res->{$FAIL_XFAIL}}));
929 printf " | %-40s | %7d |\n", $FAIL_UNSUPPORTED, scalar(@{$res->{$FAIL_UNSUPPORTED}}) if (scalar(@{$res->{$FAIL_UNSUPPORTED}}));
930 printf " | %-40s | %7d |\n", $FAIL_UNTESTED, scalar(@{$res->{$FAIL_UNTESTED}}) if (scalar(@{$res->{$FAIL_UNTESTED}}));
931 printf " | %-40s | %7d |\n", $FAIL_DISAPPEARS, scalar(@{$res->{$FAIL_DISAPPEARS}}) if (scalar(@{$res->{$FAIL_DISAPPEARS}}));
Christophe Lyon3b675e82018-11-30 15:24:32 +0000932 printf " | %-40s | %7d |\n", $XFAIL_DISAPPEARS, scalar(@{$res->{$XFAIL_DISAPPEARS}}) if (scalar(@{$res->{$XFAIL_DISAPPEARS}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200933 printf " | %-40s | %7d |\n", $XFAIL_PASS, scalar(@{$res->{$XFAIL_PASS}}) if (scalar(@{$res->{$XFAIL_PASS}}));
934 printf " | %-40s | %7d |\n", $XFAIL_XPASS, scalar(@{$res->{$XFAIL_XPASS}}) if (scalar(@{$res->{$XFAIL_XPASS}}));
935 printf " | %-40s | %7d |\n", $XFAIL_UNSUPPORTED, scalar(@{$res->{$XFAIL_UNSUPPORTED}}) if (scalar(@{$res->{$XFAIL_UNSUPPORTED}}));
936 printf " | %-40s | %7d |\n", $XFAIL_UNTESTED, scalar(@{$res->{$XFAIL_UNTESTED}}) if (scalar(@{$res->{$XFAIL_UNTESTED}}));
937 printf " | %-40s | %7d |\n", $XFAIL_APPEARS, scalar(@{$res->{$XFAIL_APPEARS}}) if (scalar(@{$res->{$XFAIL_APPEARS}}));
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000938 printf " | %-40s | %7d |\n", $KFAIL_PASS, scalar(@{$res->{$KFAIL_PASS}}) if (scalar(@{$res->{$KFAIL_PASS}}));
939 printf " | %-40s | %7d |\n", $KFAIL_XPASS, scalar(@{$res->{$KFAIL_XPASS}}) if (scalar(@{$res->{$KFAIL_XPASS}}));
940 printf " | %-40s | %7d |\n", $KFAIL_XFAIL, scalar(@{$res->{$KFAIL_XFAIL}}) if (scalar(@{$res->{$KFAIL_XFAIL}}));
941 printf " | %-40s | %7d |\n", $KFAIL_UNSUPPORTED, scalar(@{$res->{$KFAIL_UNSUPPORTED}}) if (scalar(@{$res->{$KFAIL_UNSUPPORTED}}));
942 printf " | %-40s | %7d |\n", $KFAIL_UNTESTED, scalar(@{$res->{$KFAIL_UNTESTED}}) if (scalar(@{$res->{$KFAIL_UNTESTED}}));
943 printf " | %-40s | %7d |\n", $KFAIL_DISAPPEARS, scalar(@{$res->{$KFAIL_DISAPPEARS}}) if (scalar(@{$res->{$KFAIL_DISAPPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100944 printf " | %-40s | %7d |\n", $UNSUPPORTED_PASS, scalar(@{$res->{$UNSUPPORTED_PASS}}) if (scalar(@{$res->{$UNSUPPORTED_PASS}}));
945 printf " | %-40s | %7d |\n", $UNSUPPORTED_XFAIL, scalar(@{$res->{$UNSUPPORTED_XFAIL}}) if (scalar(@{$res->{$UNSUPPORTED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200946 printf " | %-40s | %7d |\n", $UNSUPPORTED_UNTESTED, scalar(@{$res->{$UNSUPPORTED_UNTESTED}}) if (scalar(@{$res->{$UNSUPPORTED_UNTESTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100947 printf " | %-40s | %7d |\n", $UNSUPPORTED_DISAPPEARS, scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200948 printf " | %-40s | %7d |\n", $UNSUPPORTED_APPEARS, scalar(@{$res->{$UNSUPPORTED_APPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100949 printf " | %-40s | %7d |\n", $UNTESTED_PASS, scalar(@{$res->{$UNTESTED_PASS}}) if (scalar(@{$res->{$UNTESTED_PASS}}));
950 printf " | %-40s | %7d |\n", $UNTESTED_XFAIL, scalar(@{$res->{$UNTESTED_XFAIL}}) if (scalar(@{$res->{$UNTESTED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200951 printf " | %-40s | %7d |\n", $UNTESTED_UNSUPPORTED, scalar(@{$res->{$UNTESTED_UNSUPPORTED}}) if (scalar(@{$res->{$UNTESTED_UNSUPPORTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100952 printf " | %-40s | %7d |\n", $UNTESTED_DISAPPEARS, scalar(@{$res->{$UNTESTED_DISAPPEARS}}) if (scalar(@{$res->{$UNTESTED_DISAPPEARS}}));
Christophe Lyondc66fc52016-04-05 17:38:07 +0200953 printf " | %-40s | %7d |\n", $UNTESTED_APPEARS, scalar(@{$res->{$UNTESTED_APPEARS}}) if (scalar(@{$res->{$UNTESTED_APPEARS}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100954 printf " | %-40s | %7d |\n", $UNRESOLVED_PASS, scalar(@{$res->{$UNRESOLVED_PASS}}) if (scalar(@{$res->{$UNRESOLVED_PASS}}));
955 printf " | %-40s | %7d |\n", $UNRESOLVED_XFAIL, scalar(@{$res->{$UNRESOLVED_XFAIL}}) if (scalar(@{$res->{$UNRESOLVED_XFAIL}}));
Christophe Lyon9dde3332016-06-28 23:00:00 +0200956 printf " | %-40s | %7d |\n", $UNRESOLVED_UNSUPPORTED, scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}) if (scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}));
957 printf " | %-40s | %7d |\n", $UNRESOLVED_UNTESTED, scalar(@{$res->{$UNRESOLVED_UNTESTED}}) if (scalar(@{$res->{$UNRESOLVED_UNTESTED}}));
Christophe Lyona140aa82015-12-17 22:53:03 +0100958 printf " | %-40s | %7d |\n", $UNRESOLVED_DISAPPEARS, scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}) if (scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}));
Christophe Lyonbcbd7482016-09-19 14:54:50 +0200959 printf " | %-40s | %7d |\n", $ERROR_DISAPPEARS, scalar(@{$res->{$ERROR_DISAPPEARS}}) if (scalar(@{$res->{$ERROR_DISAPPEARS}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100960 printf " | %-40s | %7d |\n", $UNHANDLED_CASES, scalar(@{$res->{$UNHANDLED_CASES}}) if (scalar(@{$res->{$UNHANDLED_CASES}}));
961 printf " | %-40s | %7d |\n", $UNSTABLE_CASES, scalar(@{$res->{$UNSTABLE_CASES}}) if (scalar(@{$res->{$UNSTABLE_CASES}}));
Christophe Lyon73ac1d82018-06-12 13:32:47 +0000962 printf " | %-40s | %7d |\n", $HWDEP_CASES, scalar(@{$res->{$HWDEP_CASES}}) if (scalar(@{$res->{$HWDEP_CASES}}));
Christophe Lyonbff39612015-11-18 16:29:11 +0100963 printf " +------------------------------------------+---------+\n";
Christophe Lyon924cce42018-11-30 15:38:19 +0000964 printf " | %-40s | %7d |\n", "TOTAL_IMPROVEMENTS_TO_BE_CHECKED", $total_better + scalar(@{$res->{$UNSTABLE_CASES}});;
Christophe Lyonbff39612015-11-18 16:29:11 +0100965 printf " +------------------------------------------+---------+\n";
966 printf "\n";
967
968 if ($long)
969 {
Christophe Lyon28a92782017-09-13 09:00:39 +0000970 print_tclist($res, $PASS_DISAPPEARS, @{$res->{$PASS_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000971 print_tclist($res, $PASS_XFAIL, @{$res->{$PASS_XFAIL}});
972 print_tclist($res, $PASS_APPEARS, @{$res->{$PASS_APPEARS}});
973 print_tclist($res, $PASS_UNSUPPORTED, @{$res->{$PASS_UNSUPPORTED}});
974 print_tclist($res, $PASS_UNTESTED, @{$res->{$PASS_UNTESTED}});
975 print_tclist($res, $XPASS_PASS, @{$res->{$XPASS_PASS}});
976 print_tclist($res, $XPASS_XFAIL, @{$res->{$XPASS_XFAIL}});
977 print_tclist($res, $XPASS_UNSUPPORTED, @{$res->{$XPASS_UNSUPPORTED}});
978 print_tclist($res, $XPASS_UNTESTED, @{$res->{$XPASS_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000979 print_tclist($res, $XPASS_DISAPPEARS, @{$res->{$XPASS_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000980 print_tclist($res, $FAIL_PASS, @{$res->{$FAIL_PASS}});
981 print_tclist($res, $FAIL_XPASS, @{$res->{$FAIL_XPASS}});
982 print_tclist($res, $FAIL_XFAIL, @{$res->{$FAIL_XFAIL}});
983 print_tclist($res, $FAIL_UNSUPPORTED, @{$res->{$FAIL_UNSUPPORTED}});
984 print_tclist($res, $FAIL_UNTESTED, @{$res->{$FAIL_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +0000985 print_tclist($res, $FAIL_DISAPPEARS, @{$res->{$FAIL_DISAPPEARS}});
Christophe Lyon3b675e82018-11-30 15:24:32 +0000986 print_tclist($res, $XFAIL_DISAPPEARS, @{$res->{$XFAIL_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000987 print_tclist($res, $XFAIL_PASS, @{$res->{$XFAIL_PASS}});
988 print_tclist($res, $XFAIL_XPASS, @{$res->{$XFAIL_XPASS}});
989 print_tclist($res, $XFAIL_UNSUPPORTED, @{$res->{$XFAIL_UNSUPPORTED}});
990 print_tclist($res, $XFAIL_UNTESTED, @{$res->{$XFAIL_UNTESTED}});
991 print_tclist($res, $XFAIL_APPEARS, @{$res->{$XFAIL_APPEARS}});
Thiago Jung Bauermann3be267a2023-02-28 23:30:09 +0000992 print_tclist($res, $KFAIL_PASS, @{$res->{$KFAIL_PASS}});
993 print_tclist($res, $KFAIL_XPASS, @{$res->{$KFAIL_XPASS}});
994 print_tclist($res, $KFAIL_XFAIL, @{$res->{$KFAIL_XFAIL}});
995 print_tclist($res, $KFAIL_UNSUPPORTED, @{$res->{$KFAIL_UNSUPPORTED}});
996 print_tclist($res, $KFAIL_UNTESTED, @{$res->{$KFAIL_UNTESTED}});
997 print_tclist($res, $KFAIL_DISAPPEARS, @{$res->{$KFAIL_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +0000998 print_tclist($res, $UNSUPPORTED_PASS, @{$res->{$UNSUPPORTED_PASS}});
999 print_tclist($res, $UNSUPPORTED_XFAIL, @{$res->{$UNSUPPORTED_XFAIL}});
1000 print_tclist($res, $UNSUPPORTED_UNTESTED, @{$res->{$UNSUPPORTED_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +00001001 print_tclist($res, $UNSUPPORTED_DISAPPEARS, @{$res->{$UNSUPPORTED_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +00001002 print_tclist($res, $UNSUPPORTED_APPEARS, @{$res->{$UNSUPPORTED_APPEARS}});
1003 print_tclist($res, $UNTESTED_PASS, @{$res->{$UNTESTED_PASS}});
1004 print_tclist($res, $UNTESTED_XFAIL, @{$res->{$UNTESTED_XFAIL}});
1005 print_tclist($res, $UNTESTED_UNSUPPORTED, @{$res->{$UNTESTED_UNSUPPORTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +00001006 print_tclist($res, $UNTESTED_DISAPPEARS, @{$res->{$UNTESTED_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +00001007 print_tclist($res, $UNTESTED_APPEARS, @{$res->{$UNTESTED_APPEARS}});
1008 print_tclist($res, $UNRESOLVED_PASS, @{$res->{$UNRESOLVED_PASS}});
1009 print_tclist($res, $UNRESOLVED_XFAIL, @{$res->{$UNRESOLVED_XFAIL}});
1010 print_tclist($res, $UNRESOLVED_UNSUPPORTED, @{$res->{$UNRESOLVED_UNSUPPORTED}});
1011 print_tclist($res, $UNRESOLVED_UNTESTED, @{$res->{$UNRESOLVED_UNTESTED}});
Christophe Lyon28a92782017-09-13 09:00:39 +00001012 print_tclist($res, $UNRESOLVED_DISAPPEARS, @{$res->{$UNRESOLVED_DISAPPEARS}});
1013 print_tclist($res, $ERROR_DISAPPEARS, @{$res->{$ERROR_DISAPPEARS}});
Christophe Lyon14d1ec82017-03-23 14:59:58 +00001014 print_tclist($res, $UNHANDLED_CASES, @{$res->{$UNHANDLED_CASES}});
1015 print_tclist($res, $UNSTABLE_CASES, @{$res->{$UNSTABLE_CASES}});
Christophe Lyon73ac1d82018-06-12 13:32:47 +00001016 print_tclist($res, $HWDEP_CASES, @{$res->{$HWDEP_CASES}});
Christophe Lyonbff39612015-11-18 16:29:11 +01001017 }
1018 printf "$col_reset\n";
1019 }
1020
Christophe Lyonf5aeb342015-12-08 14:47:16 +01001021 $return_value = 1 if ($total_better);
Christophe Lyonbff39612015-11-18 16:29:11 +01001022
1023 $return_value = 2 if ($rtotal);
1024
Christophe Lyond618f662016-02-02 19:07:58 +01001025 # Error if there was no PASS (eg when sth went wrong and no .sum was generated)
1026 $return_value = 2 if (($res->{PASS} + $res->{XFAIL}) == 0);
1027
1028 # Error if every test passed, or the ratio was too low. This
1029 # generally means the simulator is not configured well.
1030 $return_value = 2 if (($ref_ratio == 100) || ($ref_ratio < $ratio_thresh));
1031 $return_value = 2 if (($res_ratio == 100) || ($res_ratio < $ratio_thresh));
Christophe Lyonbff39612015-11-18 16:29:11 +01001032
Christophe Lyonad8c7242016-02-03 13:04:28 +01001033 # Error if no execution test passed.
1034 # It is possible that no execution test fails, though.
1035 $return_value = 2 if (($ignore_exec == 0)
1036 && (($ref->{EXEC}->{PASS} == 0)
1037 || ($res->{EXEC}->{PASS} == 0)));
1038
Christophe Lyonbff39612015-11-18 16:29:11 +01001039 return $return_value;
1040}