Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 1 | #!/usr/bin/env perl |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | |
| 5 | use File::Glob; |
| 6 | use Getopt::Long; |
| 7 | use Term::ANSIColor qw(:constants); |
| 8 | use File::Basename; |
| 9 | use Cwd; |
| 10 | |
| 11 | my $app = $0; |
| 12 | |
| 13 | sub read_sum($); |
| 14 | sub read_unstable($); |
| 15 | sub dump_result($); |
| 16 | sub compare_results($$); |
| 17 | sub usage(); |
| 18 | sub print_compare_results_summary($$); |
| 19 | sub nothing($$$$); |
| 20 | |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 21 | # OK |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 22 | my $STILL_PASSES = "Still passes [PASS => PASS]"; |
| 23 | my $STILL_FAILS = "Still fails [FAIL => FAIL]"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 24 | my $STILL_XPASS = "Still xpass [XPASS=>XPASS]"; |
| 25 | my $STILL_XFAIL = "Still xfail [XFAIL=>XFAIL]"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 26 | |
| 27 | # TO BE CHECKED |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 28 | my $PASS_NOW_XFAIL = "PASS now XFAIL [PASS =>XFAIL]"; |
| 29 | my $XFAIL_APPEARS = "XFAIL appears [ =>XFAIL]"; |
| 30 | my $FAIL_NOW_XFAIL = "FAIL now XFAIL [FAIL =>XFAIL]"; |
| 31 | my $XPASS_NOW_XFAIL = "XPASS now XFAIL [XPASS=>XFAIL]"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 32 | my $PASSED_NOW_TIMEOUTS = "Timeout [PASS =>T.OUT]"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 33 | my $FAIL_DISAPPEARS = "FAIL disappears [FAIL => ]"; |
| 34 | my $XPASS_NOW_PASSES = "XPASS now PASS [XPASS=> PASS]"; |
| 35 | my $XFAIL_NOW_PASSES = "XFAIL now PASS [XFAIL=> PASS]"; |
| 36 | my $XFAIL_NOW_XPASS = "XFAIL now XPASS [XFAIL=>XPASS]"; |
| 37 | my $FAIL_NOW_PASSES = "FAIL now PASS [FAIL => PASS]"; |
| 38 | my $FAIL_NOW_XPASS = "FAIL now XPASS [FAIL =>XPASS]"; |
| 39 | my $NEW_PASSES = "New PASS [ => PASS]"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 40 | my $UNHANDLED_CASES = "Unhandled cases [ ..??.. ]"; |
| 41 | my $UNSTABLE_CASES = "Unstable cases, ignored [~RANDOM ]"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 42 | my $UNSUPPORTED_XPASS = "UNSUPPORTED now XPASS [UNSUP=>XPASS]"; |
| 43 | my $UNSUPPORTED_XFAIL = "UNSUPPORTED now XFAIL [UNSUP=>XFAIL]"; |
| 44 | my $UNSUPPORTED_DISAPPEARS= "UNSUPPORTED disappears [UNSUP=> ]"; |
| 45 | my $UNTESTED_PASS = "UNTESTED now PASS [UNTES=> PASS]"; |
| 46 | my $UNTESTED_XFAIL = "UNTESTED now XFAIL [UNTES=>XFAIL]"; |
| 47 | my $UNTESTED_DISAPPEARS = "UNTESTED disappears [UNTES=> ]"; |
| 48 | my $UNRESOLVED_PASS = "UNRESOLVED now PASS [UNRES=> PASS]"; |
| 49 | my $UNRESOLVED_XFAIL = "UNRESOLVED now XFAIL [UNRES=>XFAIL]"; |
| 50 | my $UNRESOLVED_DISAPPEARS = "UNRESOLVED disappears [UNRES=> ]"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 51 | |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 52 | # REGRESSIONS |
| 53 | my $PASS_NOW_XPASS = "PASS now XPASS [PASS =>XPASS]"; |
| 54 | my $PASSED_NOW_FAILS = "PASS now FAIL [PASS => FAIL]"; |
| 55 | my $PASS_DISAPPEARS = "PASS disappears [PASS => ]"; |
| 56 | my $XPASS_DISAPPEARS = "XPASS disappears [XPASS=> ]"; |
| 57 | my $FAIL_APPEARS = "FAIL appears [ => FAIL]"; |
| 58 | my $XPASS_APPEARS = "XPASS appears [ =>XPASS]"; |
| 59 | my $XPASS_NOW_FAIL = "XPASS now FAIL [XPASS=> FAIL]"; |
| 60 | my $XFAIL_NOW_FAIL = "XFAIL now FAIL [XFAIL=> FAIL]"; |
| 61 | my $XFAIL_DISAPPEARS = "XFAIL disappears [XFAIL=> ]"; |
| 62 | |
| 63 | my $UNSUPPORTED_PASS = "UNSUPPORTED now PASS [UNSUP=> PASS]"; |
| 64 | my $UNSUPPORTED_FAIL = "UNSUPPORTED now FAIL [UNSUP=> FAIL]"; |
| 65 | my $UNTESTED_FAIL = "UNTESTED now FAIL [UNTES=> FAIL]"; |
| 66 | my $UNTESTED_XPASS = "UNTESTED now XPASS [UNTES=>XPASS]"; |
| 67 | my $UNRESOLVED_FAIL = "UNRESOLVED now FAIL [UNRES=> FAIL]"; |
| 68 | my $UNRESOLVED_XPASS = "UNRESOLVED now XPASS [UNRES=>XPASS]"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 69 | |
| 70 | my @handler_list = ( |
| 71 | {was=>"PASS", is=>"PASS", cat=>$STILL_PASSES}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 72 | {was=>"PASS", is=>"XPASS", cat=>$PASS_NOW_XPASS}, |
| 73 | {was=>"XPASS", is=>"PASS", cat=>$XPASS_NOW_PASSES}, |
| 74 | {was=>"XPASS", is=>"XPASS", cat=>$STILL_XPASS}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 75 | {was=>"FAIL", is=>"FAIL", cat=>$STILL_FAILS}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 76 | {was=>"FAIL", is=>"XFAIL", cat=>$FAIL_NOW_XFAIL}, |
| 77 | {was=>"XFAIL", is=>"FAIL", cat=>$XFAIL_NOW_FAIL}, |
| 78 | {was=>"XFAIL", is=>"XFAIL", cat=>$STILL_XFAIL}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 79 | |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 80 | {was=>"XPASS", is=>"XFAIL", cat=>$XPASS_NOW_XFAIL}, |
| 81 | {was=>"PASS", is=>"XFAIL", cat=>$PASS_NOW_XFAIL}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 82 | {was=>"FAIL", is=>"NO_EXIST", cat=>$FAIL_DISAPPEARS}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 83 | {was=>"XFAIL", is=>"NO_EXIST", cat=>$XFAIL_DISAPPEARS}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 84 | {was=>"XFAIL", is=>"PASS", cat=>$XFAIL_NOW_PASSES}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 85 | {was=>"XFAIL", is=>"XPASS", cat=>$XFAIL_NOW_XPASS}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 86 | {was=>"FAIL", is=>"PASS", cat=>$FAIL_NOW_PASSES}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 87 | {was=>"FAIL", is=>"XPASS", cat=>$FAIL_NOW_XPASS}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 88 | {was=>"NO_EXIST", is=>"PASS", cat=>$NEW_PASSES}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 89 | {was=>"NO_EXIST", is=>"XPASS", cat=>$XPASS_APPEARS}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 90 | |
| 91 | {was=>"PASS", is=>"FAIL", handler=>\&handle_pass_fail}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 92 | {was=>"XPASS", is=>"FAIL", cat=>$XPASS_NOW_FAIL}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 93 | {was=>"PASS", is=>"NO_EXIST", cat=>$PASS_DISAPPEARS}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 94 | {was=>"XPASS", is=>"NO_EXIST", cat=>$XPASS_DISAPPEARS}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 95 | {was=>"NO_EXIST", is=>"FAIL", cat=>$FAIL_APPEARS}, |
| 96 | {was=>"NO_EXIST", is=>"XFAIL", cat=>$XFAIL_APPEARS}, |
| 97 | |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 98 | {was=>"UNSUPPORTED", is=>"PASS", cat=>$UNSUPPORTED_PASS}, |
| 99 | {was=>"UNSUPPORTED", is=>"XPASS", cat=>$UNSUPPORTED_XPASS}, |
| 100 | {was=>"UNSUPPORTED", is=>"FAIL", cat=>$UNSUPPORTED_FAIL}, |
| 101 | {was=>"UNSUPPORTED", is=>"XFAIL", cat=>$UNSUPPORTED_XFAIL}, |
| 102 | {was=>"UNSUPPORTED", is=>"NO_EXIST", cat=>$UNSUPPORTED_DISAPPEARS}, |
| 103 | |
| 104 | {was=>"UNTESTED", is=>"PASS", cat=>$UNTESTED_PASS}, |
| 105 | {was=>"UNTESTED", is=>"XPASS", cat=>$UNTESTED_XPASS}, |
| 106 | {was=>"UNTESTED", is=>"FAIL", cat=>$UNTESTED_FAIL}, |
| 107 | {was=>"UNTESTED", is=>"XFAIL", cat=>$UNTESTED_XFAIL}, |
| 108 | {was=>"UNTESTED", is=>"NO_EXIST", cat=>$UNTESTED_DISAPPEARS}, |
| 109 | |
| 110 | {was=>"UNRESOLVED", is=>"PASS", cat=>$UNRESOLVED_PASS}, |
| 111 | {was=>"UNRESOLVED", is=>"XPASS", cat=>$UNRESOLVED_XPASS}, |
| 112 | {was=>"UNRESOLVED", is=>"FAIL", cat=>$UNRESOLVED_FAIL}, |
| 113 | {was=>"UNRESOLVED", is=>"XFAIL", cat=>$UNRESOLVED_XFAIL}, |
| 114 | {was=>"UNRESOLVED", is=>"NO_EXIST", cat=>$UNRESOLVED_DISAPPEARS}, |
| 115 | |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 116 | # {was=>"NO_EXIST", is=>"NO_EXIST", handler=>\&handle_not_yet_supported} |
| 117 | ); |
| 118 | |
| 119 | ###################################################### |
| 120 | # TREAT ARGUMENTS |
| 121 | |
| 122 | my $verbose=0; |
| 123 | my $quiet=0; |
| 124 | my $long=0; |
| 125 | my $short=0; |
| 126 | my $debug=0; |
| 127 | my ($testroot, $basename); |
| 128 | my ($ref_file_name, $res_file_name); |
| 129 | my $nounstable=0; |
| 130 | my $unstablefile=0; |
| 131 | my @unstable_markers=(); |
| 132 | |
| 133 | GetOptions ("l" => \$long, |
| 134 | "s" => \$short, |
| 135 | "q" => \$quiet, |
| 136 | "v" => \$verbose, |
| 137 | "dbg" => \$debug, |
| 138 | "testroot=s" => \$testroot, |
| 139 | "basename=s" => \$basename, |
| 140 | "no-unstable" => \$nounstable, |
| 141 | "unstable-tests=s" => \$unstablefile, |
| 142 | "unstable-marker=s" => \@unstable_markers); |
| 143 | |
| 144 | $ref_file_name = $ARGV[0] if ($#ARGV == 1); |
| 145 | $res_file_name = $ARGV[1] if ($#ARGV == 1); |
| 146 | |
| 147 | $ref_file_name = $testroot."/expected_results/".$basename if ($testroot and $basename); |
| 148 | $res_file_name = $testroot."/testing/run/".$basename if ($testroot and $basename); |
| 149 | &usage if (not $ref_file_name or not $res_file_name); |
| 150 | |
| 151 | my ($col_boldred, $col_red, $col_boldgreen, $col_green, $col_boldpink, $col_pink, $col_reset) |
| 152 | = ("\033[31;1m","\033[31;3m","\033[32;1m","\033[32;3m","\033[35;1m","\033[35;2m","\033[0m"); |
| 153 | ($col_boldred, $col_red, $col_boldgreen, $col_green, $col_boldpink, $col_pink, $col_reset) |
| 154 | = ("","","","","","","") if (not I_am_interactive()); |
| 155 | |
| 156 | ###################################################### |
| 157 | # MAIN PROGRAM |
| 158 | # print "comparing $ref_file_name $res_file_name\n"; |
| 159 | |
| 160 | # If none of the 2 .sum exists, nothing to compare: exit early. |
| 161 | exit 0 if ( (! -e $ref_file_name) && (! -e $res_file_name )); |
| 162 | |
| 163 | my $ref = read_sum($ref_file_name) ; |
| 164 | my $res = read_sum($res_file_name) ; |
| 165 | my @unstablelist = (); |
| 166 | |
| 167 | @unstablelist = read_unstable($unstablefile) if ($unstablefile ne 0); |
| 168 | |
| 169 | compare_results($ref, $res); |
| 170 | |
| 171 | my $final_result = print_compare_results_summary($ref, $res); |
| 172 | |
| 173 | exit $final_result; |
| 174 | |
| 175 | ###################################################### |
| 176 | # UTILITIES |
| 177 | |
| 178 | sub empty_result() |
| 179 | { |
| 180 | my %empty_result;# = {PASS=>0, FAIL=>0, XPASS=>0, XFAIL=>0, UNSUPPORTED=>0, UNTESTED=>0, UNRESOLVED=>0}; |
| 181 | $empty_result{PASS}=$empty_result{FAIL}=$empty_result{XPASS}=$empty_result{XFAIL}=0; |
| 182 | $empty_result{UNSUPPORTED}=$empty_result{UNTESTED}=$empty_result{UNRESOLVED}=$empty_result{NO_EXIST}=0; |
| 183 | return \%empty_result; |
| 184 | } |
| 185 | sub I_am_interactive { |
| 186 | return -t STDIN && -t STDOUT; |
| 187 | } |
| 188 | sub usage() |
| 189 | { |
| 190 | print "Usage : $app <ref_file.sum> <result_file.sum>\n"; |
| 191 | exit 1; |
| 192 | } |
| 193 | |
| 194 | |
| 195 | ###################################################### |
| 196 | # PARSING |
| 197 | sub read_sum($) |
| 198 | { |
| 199 | my ($sum_file) = @_; |
| 200 | my $res = empty_result(); |
| 201 | my %testcases; |
| 202 | my %unsupported; |
| 203 | $res->{testcases} = \%testcases; |
| 204 | my $pending_timeout=0; |
| 205 | |
| 206 | open SUMFILE, $sum_file or die $!; |
| 207 | while (<SUMFILE>) |
| 208 | { |
| 209 | if (m/^(PASS|XPASS|FAIL|XFAIL|UNSUPPORTED|UNTESTED|UNRESOLVED): (.*)/) |
| 210 | { |
| 211 | my ($diag,$tc) = ($1,$2); |
| 212 | my %tcresult; |
| 213 | $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./; |
| 214 | $testcases{$tc} = empty_result() if (not exists $testcases{$tc}); |
| 215 | $testcases{$tc}->{$diag}++; |
| 216 | $testcases{$tc}->{HAS_TIMED_OUT} = $pending_timeout; |
| 217 | $pending_timeout = 0; |
| 218 | $res->{$diag}++; |
| 219 | } |
| 220 | elsif (m/WARNING: program timed out/) |
| 221 | { |
| 222 | $pending_timeout = 1; |
| 223 | } |
| 224 | elsif (m/^(# of expected passes|# of unexpected failures|# of expected failures|# of known failures|# of unsupported tests|# of untested testcases)\s+(.*)/) |
| 225 | { |
| 226 | $res->{"summary - "."$1"} = $2; |
| 227 | } |
| 228 | elsif (m/^\/.*\/([^\/]+)\s+version\s+(.*)/) |
| 229 | { |
| 230 | $res->{tool} = $1; |
| 231 | $res->{version} = $2; |
| 232 | $res->{version} =~ s/ [-(].*//; |
| 233 | } |
| 234 | } |
| 235 | close SUMFILE; |
| 236 | return $res; |
| 237 | } |
| 238 | |
| 239 | # Parse list on unstable tests |
| 240 | sub read_unstable($) |
| 241 | { |
| 242 | my ($unstable_file) = @_; |
| 243 | my @unstable_tests = (); |
| 244 | |
| 245 | open UNSTABLEFILE, $unstable_file or die $!; |
| 246 | while (<UNSTABLEFILE>) |
| 247 | { |
| 248 | # Skip lines starting with '#', or with spaces only |
| 249 | if ((/^#/) || (/^[ ]*$/)) |
| 250 | { |
| 251 | } |
| 252 | else |
| 253 | { |
| 254 | chomp; |
| 255 | |
| 256 | my $test = $_; |
| 257 | |
| 258 | # Check if line is of type: target:testname |
Christophe Lyon | 5e7241c | 2015-12-04 12:57:27 +0100 | [diff] [blame] | 259 | if (/^(.*?):/) |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 260 | { |
| 261 | foreach my $unstable_marker (@unstable_markers) |
| 262 | { |
| 263 | if ($unstable_marker eq $1) { |
| 264 | # If target matches the one supplied as script |
| 265 | # argument, add the testname to the list |
Christophe Lyon | 5e7241c | 2015-12-04 12:57:27 +0100 | [diff] [blame] | 266 | $test =~ s/.*?://; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 267 | push @unstable_tests, $test; |
| 268 | } |
| 269 | } |
| 270 | } else { |
| 271 | push @unstable_tests, $test; |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | close UNSTABLEFILE; |
| 276 | return @unstable_tests; |
| 277 | } |
| 278 | |
| 279 | ###################################################### |
| 280 | # DIFFING |
| 281 | sub handle_pass_fail($$$$) |
| 282 | { |
| 283 | my ($ref, $res, $diag_diag, $tc) = @_; |
| 284 | if ($res->{testcases}->{$tc}->{HAS_TIMED_OUT}) |
| 285 | { |
| 286 | push @{$res->{$PASSED_NOW_TIMEOUTS}}, $tc; |
| 287 | } |
| 288 | else |
| 289 | { |
| 290 | push @{$res->{$PASSED_NOW_FAILS}}, $tc; |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | sub compare_results($$) |
| 295 | { |
| 296 | my ($ref, $res) = @_; |
| 297 | |
| 298 | @{$res->{$STILL_PASSES}} = (); |
| 299 | @{$res->{$STILL_FAILS}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 300 | @{$res->{$STILL_XPASS}} = (); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 301 | @{$res->{$PASSED_NOW_FAILS}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 302 | @{$res->{$XPASS_NOW_FAIL}} = (); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 303 | @{$res->{$PASS_DISAPPEARS}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 304 | @{$res->{$XPASS_DISAPPEARS}} = (); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 305 | @{$res->{$FAIL_APPEARS}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 306 | @{$res->{$XPASS_APPEARS}} = (); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 307 | @{$res->{$NEW_PASSES}} = (); |
| 308 | @{$res->{$FAIL_DISAPPEARS}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 309 | @{$res->{$XFAIL_DISAPPEARS}} = (); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 310 | @{$res->{$XFAIL_APPEARS}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 311 | @{$res->{$FAIL_NOW_XFAIL}} = (); |
| 312 | @{$res->{$PASS_NOW_XFAIL}} = (); |
| 313 | @{$res->{$XPASS_NOW_XFAIL}} = (); |
| 314 | @{$res->{$XPASS_APPEARS}} = (); |
| 315 | @{$res->{$PASS_NOW_XPASS}} = (); |
| 316 | @{$res->{$XPASS_NOW_PASSES}} = (); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 317 | @{$res->{$XFAIL_NOW_PASSES}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 318 | @{$res->{$XFAIL_NOW_XPASS}} = (); |
| 319 | @{$res->{$XFAIL_NOW_FAIL}} = (); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 320 | @{$res->{$FAIL_NOW_PASSES}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 321 | @{$res->{$FAIL_NOW_XPASS}} = (); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 322 | @{$res->{$PASSED_NOW_TIMEOUTS}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 323 | @{$res->{$UNSUPPORTED_PASS}} = (); |
| 324 | @{$res->{$UNSUPPORTED_XPASS}} = (); |
| 325 | @{$res->{$UNSUPPORTED_FAIL}} = (); |
| 326 | @{$res->{$UNSUPPORTED_XFAIL}} = (); |
| 327 | @{$res->{$UNSUPPORTED_DISAPPEARS}} = (); |
| 328 | @{$res->{$UNTESTED_PASS}} = (); |
| 329 | @{$res->{$UNTESTED_XPASS}} = (); |
| 330 | @{$res->{$UNTESTED_FAIL}} = (); |
| 331 | @{$res->{$UNTESTED_XFAIL}} = (); |
| 332 | @{$res->{$UNTESTED_DISAPPEARS}} = (); |
| 333 | @{$res->{$UNRESOLVED_PASS}} = (); |
| 334 | @{$res->{$UNRESOLVED_XPASS}} = (); |
| 335 | @{$res->{$UNRESOLVED_FAIL}} = (); |
| 336 | @{$res->{$UNRESOLVED_XFAIL}} = (); |
| 337 | @{$res->{$UNRESOLVED_DISAPPEARS}} = (); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 338 | @{$res->{$UNHANDLED_CASES}} = (); |
| 339 | @{$res->{$UNSTABLE_CASES}} = (); |
| 340 | |
| 341 | #### MERGE REF AND RES |
| 342 | foreach my $key (sort (keys %{$res->{testcases}})) |
| 343 | { |
| 344 | if (not exists $ref->{testcases}->{$key}) { |
| 345 | $ref->{testcases}->{$key} = empty_result(); |
| 346 | $ref->{testcases}->{$key}->{NO_EXIST} = 1; |
| 347 | } |
| 348 | } |
| 349 | foreach my $key (keys %{$ref->{testcases}}) |
| 350 | { |
| 351 | if (not exists $res->{testcases}->{$key}) |
| 352 | { |
| 353 | $res->{testcases}->{$key} = empty_result(); |
| 354 | $res->{testcases}->{$key}->{NO_EXIST} = 1; |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | #### ACTIONS FOR EACH CASES |
| 359 | my %unstable_found; |
| 360 | |
| 361 | foreach my $key (sort (keys %{$ref->{testcases}})) |
| 362 | { |
| 363 | foreach my $diag_diag (@handler_list) |
| 364 | { |
| 365 | if ($ref->{testcases}->{$key}->{$diag_diag->{was}} != $res->{testcases}->{$key}->{$diag_diag->{was}} |
| 366 | and $res->{testcases}->{$key}->{$diag_diag->{is}}) |
| 367 | { |
| 368 | # If testcase is listed as 'unstable' mark it as |
| 369 | # such and skip other processing. |
| 370 | { |
| 371 | if (grep { (index $key,$_)!=-1} @unstablelist) |
| 372 | { |
| 373 | print "[unstable] $key\n" if ($debug); |
| 374 | $unstable_found{$key}=1; |
| 375 | } |
| 376 | else { |
| 377 | print "[$diag_diag->{was} => $diag_diag->{is}] $key\n" if ($debug); |
| 378 | if ($diag_diag->{handler}) |
| 379 | { |
| 380 | $diag_diag->{handler} ($ref, $res, $diag_diag, $key); |
| 381 | } |
| 382 | else |
| 383 | { |
| 384 | push @{$res->{$diag_diag->{cat}}}, $key; |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | push @{$res->{$UNSTABLE_CASES}}, (sort (keys (%unstable_found))) if ($nounstable == 0); |
| 392 | |
| 393 | } |
| 394 | |
| 395 | ###################################################### |
| 396 | # PRINTING |
| 397 | sub print_tclist($@) |
| 398 | { |
| 399 | my ($cat, @tclist) = @_; |
| 400 | print " - ".$cat.":\n\n ". join("\n ",@tclist) . "\n\n" if (scalar(@tclist)); |
| 401 | } |
| 402 | |
| 403 | sub print_compare_results_summary($$) |
| 404 | { |
| 405 | my ($ref, $res) = @_; |
| 406 | my $return_value=0; |
Christophe Lyon | f5aeb34 | 2015-12-08 14:47:16 +0100 | [diff] [blame] | 407 | my $total_better = 0; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 408 | my $rtotal = 0; |
| 409 | my $quiet_reg = $quiet; |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame^] | 410 | my $ref_ratio = 0; |
| 411 | my $res_ratio = 0; |
| 412 | my $ratio_thresh = 0.95; # Warn if pass ratio is below this threshold |
| 413 | |
| 414 | # Compute the pass ratio as a sanity check |
| 415 | $ref_ratio = ($ref->{PASS} + $ref->{XFAIL}) / |
| 416 | ($ref->{PASS} + $ref->{XFAIL} |
| 417 | + $ref->{XPASS} + $ref->{FAIL} |
| 418 | + $ref->{UNRESOLVED} |
| 419 | + $ref->{UNSUPPORTED} |
| 420 | + $ref->{UNTESTED}); |
| 421 | $res_ratio = ($res->{PASS} + $res->{XFAIL}) / |
| 422 | ($res->{PASS} + $res->{XFAIL} |
| 423 | + $res->{XPASS} + $res->{FAIL} |
| 424 | + $res->{UNRESOLVED} |
| 425 | + $res->{UNSUPPORTED} |
| 426 | + $res->{UNTESTED}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 427 | |
| 428 | if (not $quiet) |
| 429 | { |
| 430 | printf "Comparing:\n"; |
| 431 | printf "REFERENCE:$ref_file_name\n"; |
| 432 | printf "CURRENT: $res_file_name\n\n"; |
| 433 | } |
| 434 | |
| 435 | #### TESTS STATUS |
| 436 | if (not $quiet and not $short) |
| 437 | { |
| 438 | printf " ` +---------+---------+\n"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 439 | printf "o RUN STATUS: | REF | RES |\n"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 440 | printf " +------------------------------------------+---------+---------+\n"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 441 | printf " | %-40s | %7d | %7d |\n", "Passes [PASS]", $ref->{PASS}, $res->{PASS}; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 442 | printf " | %-40s | %7d | %7d |\n", "Unexpected fails [FAIL]", $ref->{FAIL}, $res->{FAIL}; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 443 | printf " | %-40s | %7d | %7d |\n", "Unexpected passes [XPASS]", $ref->{XPASS}, $res->{XPASS}; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 444 | printf " | %-40s | %7d | %7d |\n", "Expected fails [XFAIL]", $ref->{XFAIL}, $res->{XFAIL}; |
| 445 | printf " | %-40s | %7d | %7d |\n", "Unresolved [UNRESOLVED]", $ref->{UNRESOLVED}, $res->{UNRESOLVED}; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 446 | printf " | %-40s | %7d | %7d |\n", "Unsupported [UNSUPPORTED]", $ref->{UNSUPPORTED}, $res->{UNSUPPORTED}; |
| 447 | printf " | %-40s | %7d | %7d |\n", "Untested [UNTESTED]", $ref->{UNTESTED}, $res->{UNTESTED}; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 448 | printf " +------------------------------------------+---------+---------+\n"; |
| 449 | printf "\n"; |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame^] | 450 | |
| 451 | printf " REF PASS ratio: %.2f\n", $ref_ratio; |
| 452 | printf " RES PASS ratio: %.2f\n", $res_ratio; |
| 453 | if ($ref_ratio < $ratio_thresh) |
| 454 | { |
| 455 | printf " ***** WARNING: REF PASS ratio is abnormally low *****\n"; |
| 456 | } |
| 457 | if ($res_ratio < $ratio_thresh) |
| 458 | { |
| 459 | printf " ***** WARNING: RES PASS ratio is abnormally low *****\n"; |
| 460 | } |
| 461 | |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 462 | } |
| 463 | |
| 464 | #### REGRESSIONS ? |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 465 | $rtotal = scalar(@{$res->{$PASSED_NOW_FAILS}}) |
| 466 | +scalar(@{$res->{$XPASS_NOW_FAIL}}) |
| 467 | +scalar(@{$res->{$PASS_DISAPPEARS}}) |
| 468 | +scalar(@{$res->{$XPASS_DISAPPEARS}}) |
| 469 | +scalar(@{$res->{$FAIL_APPEARS}}) |
| 470 | +scalar(@{$res->{$XPASS_APPEARS}}) |
| 471 | +scalar(@{$res->{$PASS_NOW_XPASS}}) |
| 472 | +scalar(@{$res->{$XFAIL_NOW_FAIL}}) |
| 473 | +scalar(@{$res->{$XFAIL_DISAPPEARS}}) |
| 474 | +scalar(@{$res->{$UNSUPPORTED_FAIL}}) |
| 475 | +scalar(@{$res->{$UNSUPPORTED_XPASS}}) |
| 476 | +scalar(@{$res->{$UNTESTED_FAIL}}) |
| 477 | +scalar(@{$res->{$UNTESTED_XPASS}}) |
| 478 | +scalar(@{$res->{$UNRESOLVED_FAIL}}) |
| 479 | +scalar(@{$res->{$UNRESOLVED_XPASS}}) |
| 480 | +scalar(@{$res->{$PASSED_NOW_TIMEOUTS}}); |
| 481 | |
| 482 | $quiet_reg=1 if ($short and not $rtotal); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 483 | |
| 484 | if (not $quiet_reg) |
| 485 | { |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 486 | printf "\n$col_red"."o REGRESSIONS:\n"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 487 | printf " +------------------------------------------+---------+\n"; |
| 488 | printf " | %-40s | %7d |\n", $PASSED_NOW_FAILS, scalar(@{$res->{$PASSED_NOW_FAILS}}) if (scalar(@{$res->{$PASSED_NOW_FAILS}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 489 | printf " | %-40s | %7d |\n", $XPASS_NOW_FAIL, scalar(@{$res->{$XPASS_NOW_FAIL}}) if (scalar(@{$res->{$XPASS_NOW_FAIL}})); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 490 | printf " | %-40s | %7d |\n", $PASS_DISAPPEARS, scalar(@{$res->{$PASS_DISAPPEARS}}) if (scalar(@{$res->{$PASS_DISAPPEARS}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 491 | printf " | %-40s | %7d |\n", $XPASS_DISAPPEARS, scalar(@{$res->{$XPASS_DISAPPEARS}}) if (scalar(@{$res->{$XPASS_DISAPPEARS}})); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 492 | printf " | %-40s | %7d |\n", $FAIL_APPEARS, scalar(@{$res->{$FAIL_APPEARS}}) if (scalar(@{$res->{$FAIL_APPEARS}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 493 | printf " | %-40s | %7d |\n", $XPASS_APPEARS, scalar(@{$res->{$XPASS_APPEARS}}) if (scalar(@{$res->{$XPASS_APPEARS}})); |
| 494 | printf " | %-40s | %7d |\n", $PASS_NOW_XPASS, scalar(@{$res->{$PASS_NOW_XPASS}}) if (scalar(@{$res->{$PASS_NOW_XPASS}})); |
| 495 | printf " | %-40s | %7d |\n", $XFAIL_NOW_FAIL, scalar(@{$res->{$XFAIL_NOW_FAIL}}) if (scalar(@{$res->{$XFAIL_NOW_FAIL}})); |
| 496 | printf " | %-40s | %7d |\n", $XFAIL_DISAPPEARS, scalar(@{$res->{$XFAIL_DISAPPEARS}}) if (scalar(@{$res->{$XFAIL_DISAPPEARS}})); |
| 497 | printf " | %-40s | %7d |\n", $UNSUPPORTED_FAIL, scalar(@{$res->{$UNSUPPORTED_FAIL}}) if (scalar(@{$res->{$UNSUPPORTED_FAIL}})); |
| 498 | printf " | %-40s | %7d |\n", $UNSUPPORTED_XPASS, scalar(@{$res->{$UNSUPPORTED_XPASS}}) if (scalar(@{$res->{$UNSUPPORTED_XPASS}})); |
| 499 | printf " | %-40s | %7d |\n", $UNTESTED_FAIL, scalar(@{$res->{$UNTESTED_FAIL}}) if (scalar(@{$res->{$UNTESTED_FAIL}})); |
| 500 | printf " | %-40s | %7d |\n", $UNTESTED_XPASS, scalar(@{$res->{$UNTESTED_XPASS}}) if (scalar(@{$res->{$UNTESTED_XPASS}})); |
| 501 | printf " | %-40s | %7d |\n", $UNRESOLVED_FAIL, scalar(@{$res->{$UNRESOLVED_FAIL}}) if (scalar(@{$res->{$UNRESOLVED_FAIL}})); |
| 502 | printf " | %-40s | %7d |\n", $UNRESOLVED_XPASS, scalar(@{$res->{$UNRESOLVED_XPASS}}) if (scalar(@{$res->{$UNRESOLVED_XPASS}})); |
| 503 | printf " | %-40s | %7d |\n", $PASSED_NOW_TIMEOUTS, scalar(@{$res->{$PASSED_NOW_TIMEOUTS}}) if (scalar(@{$res->{$PASSED_NOW_TIMEOUTS}})); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 504 | printf " +------------------------------------------+---------+\n"; |
| 505 | printf " | %-40s | %7d |\n", "TOTAL_REGRESSIONS", $rtotal; |
| 506 | printf " +------------------------------------------+---------+\n"; |
| 507 | printf "\n"; |
| 508 | |
| 509 | if ($long) |
| 510 | { |
| 511 | print_tclist($PASSED_NOW_FAILS, @{$res->{$PASSED_NOW_FAILS}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 512 | print_tclist($XPASS_NOW_FAIL, @{$res->{$XPASS_NOW_FAIL}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 513 | print_tclist($PASS_DISAPPEARS, @{$res->{$PASS_DISAPPEARS}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 514 | print_tclist($XPASS_DISAPPEARS, @{$res->{$XPASS_DISAPPEARS}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 515 | print_tclist($FAIL_APPEARS, @{$res->{$FAIL_APPEARS}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 516 | print_tclist($XPASS_APPEARS, @{$res->{$XPASS_APPEARS}}); |
| 517 | print_tclist($PASS_NOW_XPASS, @{$res->{$PASS_NOW_XPASS}}); |
| 518 | print_tclist($XFAIL_NOW_FAIL, @{$res->{$XFAIL_NOW_FAIL}}); |
| 519 | print_tclist($XFAIL_DISAPPEARS, @{$res->{$XFAIL_DISAPPEARS}}); |
| 520 | print_tclist($UNSUPPORTED_FAIL, @{$res->{$UNSUPPORTED_FAIL}}); |
| 521 | print_tclist($UNSUPPORTED_XPASS, @{$res->{$UNSUPPORTED_XPASS}}); |
| 522 | print_tclist($UNTESTED_FAIL, @{$res->{$UNTESTED_FAIL}}); |
| 523 | print_tclist($UNTESTED_XPASS, @{$res->{$UNTESTED_XPASS}}); |
| 524 | print_tclist($UNRESOLVED_FAIL, @{$res->{$UNRESOLVED_FAIL}}); |
| 525 | print_tclist($UNRESOLVED_XPASS, @{$res->{$UNRESOLVED_XPASS}}); |
| 526 | print_tclist($PASSED_NOW_TIMEOUTS, @{$res->{$PASSED_NOW_TIMEOUTS}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 527 | } |
| 528 | printf "$col_reset\n"; |
| 529 | } |
| 530 | |
| 531 | #### MINOR TO BE CHECKED ? |
| 532 | if (not $quiet and not $short) |
| 533 | { |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 534 | $total_better = scalar(@{$res->{$XPASS_NOW_PASSES}})+ |
| 535 | scalar(@{$res->{$XFAIL_NOW_PASSES}})+ |
| 536 | scalar(@{$res->{$XFAIL_NOW_XPASS}})+ |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 537 | scalar(@{$res->{$FAIL_NOW_PASSES}})+ |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 538 | scalar(@{$res->{$FAIL_NOW_XPASS}})+ |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 539 | scalar(@{$res->{$NEW_PASSES}})+ |
| 540 | scalar(@{$res->{$FAIL_DISAPPEARS}})+ |
| 541 | scalar(@{$res->{$XFAIL_APPEARS}})+ |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 542 | scalar(@{$res->{$FAIL_NOW_XFAIL}})+ |
| 543 | scalar(@{$res->{$PASS_NOW_XFAIL}})+ |
| 544 | scalar(@{$res->{$XPASS_NOW_XFAIL}})+ |
| 545 | scalar(@{$res->{$UNSUPPORTED_PASS}})+ |
| 546 | scalar(@{$res->{$UNSUPPORTED_XFAIL}})+ |
| 547 | scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}})+ |
| 548 | scalar(@{$res->{$UNTESTED_PASS}})+ |
| 549 | scalar(@{$res->{$UNTESTED_XFAIL}})+ |
| 550 | scalar(@{$res->{$UNTESTED_DISAPPEARS}})+ |
| 551 | scalar(@{$res->{$UNRESOLVED_PASS}})+ |
| 552 | scalar(@{$res->{$UNRESOLVED_XFAIL}})+ |
| 553 | scalar(@{$res->{$UNRESOLVED_DISAPPEARS}})+ |
Christophe Lyon | f5aeb34 | 2015-12-08 14:47:16 +0100 | [diff] [blame] | 554 | scalar(@{$res->{$UNHANDLED_CASES}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 555 | |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 556 | printf "$col_pink"."o MINOR TO BE CHECKED:\n"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 557 | printf " +------------------------------------------+---------+\n"; |
| 558 | printf " | %-40s | %7d |\n", $XFAIL_APPEARS, scalar(@{$res->{$XFAIL_APPEARS}}) if (scalar(@{$res->{$XFAIL_APPEARS}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 559 | printf " | %-40s | %7d |\n", $FAIL_NOW_XFAIL, scalar(@{$res->{$FAIL_NOW_XFAIL}}) if (scalar(@{$res->{$FAIL_NOW_XFAIL}})); |
| 560 | printf " | %-40s | %7d |\n", $PASS_NOW_XFAIL, scalar(@{$res->{$PASS_NOW_XFAIL}}) if (scalar(@{$res->{$PASS_NOW_XFAIL}})); |
| 561 | printf " | %-40s | %7d |\n", $XPASS_NOW_XFAIL, scalar(@{$res->{$XPASS_NOW_XFAIL}}) if (scalar(@{$res->{$XPASS_NOW_XFAIL}})); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 562 | printf " | %-40s | %7d |\n", $FAIL_DISAPPEARS, scalar(@{$res->{$FAIL_DISAPPEARS}}) if (scalar(@{$res->{$FAIL_DISAPPEARS}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 563 | printf " | %-40s | %7d |\n", $XPASS_NOW_PASSES, scalar(@{$res->{$XPASS_NOW_PASSES}}) if (scalar(@{$res->{$XPASS_NOW_PASSES}})); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 564 | printf " | %-40s | %7d |\n", $XFAIL_NOW_PASSES, scalar(@{$res->{$XFAIL_NOW_PASSES}}) if (scalar(@{$res->{$XFAIL_NOW_PASSES}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 565 | printf " | %-40s | %7d |\n", $XFAIL_NOW_XPASS, scalar(@{$res->{$XFAIL_NOW_XPASS}}) if (scalar(@{$res->{$XFAIL_NOW_XPASS}})); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 566 | printf " | %-40s | %7d |\n", $FAIL_NOW_PASSES, scalar(@{$res->{$FAIL_NOW_PASSES}}) if (scalar(@{$res->{$FAIL_NOW_PASSES}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 567 | printf " | %-40s | %7d |\n", $FAIL_NOW_XPASS, scalar(@{$res->{$FAIL_NOW_XPASS}}) if (scalar(@{$res->{$FAIL_NOW_XPASS}})); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 568 | printf " | %-40s | %7d |\n", $NEW_PASSES, scalar(@{$res->{$NEW_PASSES}}) if (scalar(@{$res->{$NEW_PASSES}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 569 | printf " | %-40s | %7d |\n", $UNSUPPORTED_PASS, scalar(@{$res->{$UNSUPPORTED_PASS}}) if (scalar(@{$res->{$UNSUPPORTED_PASS}})); |
| 570 | printf " | %-40s | %7d |\n", $UNSUPPORTED_XFAIL, scalar(@{$res->{$UNSUPPORTED_XFAIL}}) if (scalar(@{$res->{$UNSUPPORTED_XFAIL}})); |
| 571 | printf " | %-40s | %7d |\n", $UNSUPPORTED_DISAPPEARS, scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}})); |
| 572 | printf " | %-40s | %7d |\n", $UNTESTED_PASS, scalar(@{$res->{$UNTESTED_PASS}}) if (scalar(@{$res->{$UNTESTED_PASS}})); |
| 573 | printf " | %-40s | %7d |\n", $UNTESTED_XFAIL, scalar(@{$res->{$UNTESTED_XFAIL}}) if (scalar(@{$res->{$UNTESTED_XFAIL}})); |
| 574 | printf " | %-40s | %7d |\n", $UNTESTED_DISAPPEARS, scalar(@{$res->{$UNTESTED_DISAPPEARS}}) if (scalar(@{$res->{$UNTESTED_DISAPPEARS}})); |
| 575 | printf " | %-40s | %7d |\n", $UNRESOLVED_PASS, scalar(@{$res->{$UNRESOLVED_PASS}}) if (scalar(@{$res->{$UNRESOLVED_PASS}})); |
| 576 | printf " | %-40s | %7d |\n", $UNRESOLVED_XFAIL, scalar(@{$res->{$UNRESOLVED_XFAIL}}) if (scalar(@{$res->{$UNRESOLVED_XFAIL}})); |
| 577 | printf " | %-40s | %7d |\n", $UNRESOLVED_DISAPPEARS, scalar(@{$res->{$UNRESOLVED_DISAPPEARS}}) if (scalar(@{$res->{$UNRESOLVED_DISAPPEARS}})); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 578 | printf " | %-40s | %7d |\n", $UNHANDLED_CASES, scalar(@{$res->{$UNHANDLED_CASES}}) if (scalar(@{$res->{$UNHANDLED_CASES}})); |
| 579 | printf " | %-40s | %7d |\n", $UNSTABLE_CASES, scalar(@{$res->{$UNSTABLE_CASES}}) if (scalar(@{$res->{$UNSTABLE_CASES}})); |
| 580 | printf " +------------------------------------------+---------+\n"; |
Christophe Lyon | f5aeb34 | 2015-12-08 14:47:16 +0100 | [diff] [blame] | 581 | printf " | %-40s | %7d |\n", "TOTAL_MINOR_TO_BE_CHECKED", $total_better + scalar(@{$res->{$UNSTABLE_CASES}});; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 582 | printf " +------------------------------------------+---------+\n"; |
| 583 | printf "\n"; |
| 584 | |
| 585 | if ($long) |
| 586 | { |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 587 | print_tclist($XPASS_NOW_PASSES, @{$res->{$XPASS_NOW_PASSES}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 588 | print_tclist($XFAIL_NOW_PASSES, @{$res->{$XFAIL_NOW_PASSES}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 589 | print_tclist($XFAIL_NOW_XPASS, @{$res->{$XFAIL_NOW_XPASS}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 590 | print_tclist($FAIL_NOW_PASSES, @{$res->{$FAIL_NOW_PASSES}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 591 | print_tclist($FAIL_NOW_XPASS, @{$res->{$FAIL_NOW_XPASS}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 592 | print_tclist($FAIL_DISAPPEARS, @{$res->{$FAIL_DISAPPEARS}}); |
| 593 | print_tclist($XFAIL_APPEARS, @{$res->{$XFAIL_APPEARS}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 594 | print_tclist($FAIL_NOW_XFAIL, @{$res->{$FAIL_NOW_XFAIL}}); |
| 595 | print_tclist($PASS_NOW_XFAIL, @{$res->{$PASS_NOW_XFAIL}}); |
| 596 | print_tclist($XPASS_NOW_XFAIL, @{$res->{$XPASS_NOW_XFAIL}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 597 | print_tclist($UNHANDLED_CASES, @{$res->{$UNHANDLED_CASES}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 598 | print_tclist($UNSUPPORTED_PASS, @{$res->{$UNSUPPORTED_PASS}}); |
| 599 | print_tclist($UNSUPPORTED_XFAIL, @{$res->{$UNSUPPORTED_XFAIL}}); |
| 600 | print_tclist($UNSUPPORTED_DISAPPEARS, @{$res->{$UNSUPPORTED_DISAPPEARS}}); |
| 601 | print_tclist($UNTESTED_PASS, @{$res->{$UNTESTED_PASS}}); |
| 602 | print_tclist($UNTESTED_XFAIL, @{$res->{$UNTESTED_XFAIL}}); |
| 603 | print_tclist($UNTESTED_DISAPPEARS, @{$res->{$UNTESTED_DISAPPEARS}}); |
| 604 | print_tclist($UNRESOLVED_PASS, @{$res->{$UNRESOLVED_PASS}}); |
| 605 | print_tclist($UNRESOLVED_XFAIL, @{$res->{$UNRESOLVED_XFAIL}}); |
| 606 | print_tclist($UNRESOLVED_DISAPPEARS, @{$res->{$UNRESOLVED_DISAPPEARS}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 607 | print_tclist($UNSTABLE_CASES, @{$res->{$UNSTABLE_CASES}}); |
| 608 | print_tclist($NEW_PASSES, @{$res->{$NEW_PASSES}}); |
| 609 | } |
| 610 | printf "$col_reset\n"; |
| 611 | } |
| 612 | |
Christophe Lyon | f5aeb34 | 2015-12-08 14:47:16 +0100 | [diff] [blame] | 613 | $return_value = 1 if ($total_better); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 614 | |
| 615 | $return_value = 2 if ($rtotal); |
| 616 | |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame^] | 617 | # Error if there was no PASS (eg when sth went wrong and no .sum was generated) |
| 618 | $return_value = 2 if (($res->{PASS} + $res->{XFAIL}) == 0); |
| 619 | |
| 620 | # Error if every test passed, or the ratio was too low. This |
| 621 | # generally means the simulator is not configured well. |
| 622 | $return_value = 2 if (($ref_ratio == 100) || ($ref_ratio < $ratio_thresh)); |
| 623 | $return_value = 2 if (($res_ratio == 100) || ($res_ratio < $ratio_thresh)); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 624 | |
| 625 | return $return_value; |
| 626 | } |