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 | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 21 | my $PASS_PASS = "Still passes [PASS => PASS]"; |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 22 | my $PASS_XPASS = "PASS now XPASS [PASS =>XPASS]"; |
| 23 | my $PASS_FAIL = "PASS now FAIL [PASS => FAIL]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 24 | my $PASS_XFAIL = "PASS now XFAIL [PASS =>XFAIL]"; |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 25 | my $PASS_UNSUPPORTED = "PASS now UNSUPPORTED [PASS =>UNSUP]"; |
| 26 | my $PASS_UNRESOLVED = "PASS now UNRESOLVED [PASS =>UNRES]"; |
| 27 | my $PASS_UNTESTED = "PASS now UNTESTED [PASS =>UNTES]"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 28 | my $PASS_DISAPPEARS = "PASS disappears [PASS => ]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 29 | my $PASS_APPEARS = "New PASS [ => PASS]"; |
| 30 | my $PASSED_NOW_TIMEOUTS = "Timeout [PASS =>T.OUT]"; |
| 31 | |
| 32 | my $XPASS_PASS = "XPASS now PASS [XPASS=> PASS]"; |
| 33 | my $XPASS_XPASS = "Still xpass [XPASS=>XPASS]"; |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 34 | my $XPASS_FAIL = "XPASS now FAIL [XPASS=> FAIL]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 35 | my $XPASS_XFAIL = "XPASS now XFAIL [XPASS=>XFAIL]"; |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 36 | my $XPASS_UNSUPPORTED = "XPASS now UNSUPPORTED [XPASS=>UNSUP]"; |
| 37 | my $XPASS_UNRESOLVED = "XPASS now UNRESOLVED [XPASS=>UNRES]"; |
| 38 | my $XPASS_UNTESTED = "XPASS now UNTESTED [XPASS=>UNTES]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 39 | my $XPASS_DISAPPEARS = "XPASS disappears [XPASS=> ]"; |
| 40 | my $XPASS_APPEARS = "XPASS appears [ =>XPASS]"; |
| 41 | |
| 42 | my $FAIL_PASS = "FAIL now PASS [FAIL => PASS]"; |
| 43 | my $FAIL_XPASS = "FAIL now XPASS [FAIL =>XPASS]"; |
| 44 | my $FAIL_FAIL = "Still fails [FAIL => FAIL]"; |
| 45 | my $FAIL_XFAIL = "FAIL now XFAIL [FAIL =>XFAIL]"; |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 46 | my $FAIL_UNSUPPORTED = "FAIL now UNSUPPORTED [FAIL =>UNSUP]"; |
| 47 | my $FAIL_UNRESOLVED = "FAIL now UNRESOLVED [FAIL =>UNRES]"; |
| 48 | my $FAIL_UNTESTED = "FAIL now UNTESTED [FAIL =>UNTES]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 49 | my $FAIL_DISAPPEARS = "FAIL disappears [FAIL => ]"; |
| 50 | my $FAIL_APPEARS = "FAIL appears [ => FAIL]"; |
| 51 | |
| 52 | my $XFAIL_PASS = "XFAIL now PASS [XFAIL=> PASS]"; |
| 53 | my $XFAIL_XPASS = "XFAIL now XPASS [XFAIL=>XPASS]"; |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 54 | my $XFAIL_FAIL = "XFAIL now FAIL [XFAIL=> FAIL]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 55 | my $XFAIL_XFAIL = "Still xfail [XFAIL=>XFAIL]"; |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 56 | my $XFAIL_UNSUPPORTED = "XFAIL now UNSUPPORTED [XFAIL=>UNSUP]"; |
| 57 | my $XFAIL_UNRESOLVED = "XFAIL now UNRESOLVED [XFAIL=>UNRES]"; |
| 58 | my $XFAIL_UNTESTED = "XFAIL now UNTESTED [XFAIL=>UNTES]"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 59 | my $XFAIL_DISAPPEARS = "XFAIL disappears [XFAIL=> ]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 60 | my $XFAIL_APPEARS = "XFAIL appears [ =>XFAIL]"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 61 | |
| 62 | my $UNSUPPORTED_PASS = "UNSUPPORTED now PASS [UNSUP=> PASS]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 63 | my $UNSUPPORTED_XPASS = "UNSUPPORTED now XPASS [UNSUP=>XPASS]"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 64 | my $UNSUPPORTED_FAIL = "UNSUPPORTED now FAIL [UNSUP=> FAIL]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 65 | my $UNSUPPORTED_XFAIL = "UNSUPPORTED now XFAIL [UNSUP=>XFAIL]"; |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 66 | my $UNSUPPORTED_UNSUPPORTED= "UNSUPP now UNSUPP [UNSUP=>UNSUP]"; |
| 67 | my $UNSUPPORTED_UNRESOLVED= "UNSUPP now UNRESOLVED [UNSUP=>UNRES]"; |
| 68 | my $UNSUPPORTED_UNTESTED = "UNSUPP now UNTESTED [UNSUP=>UNTES]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 69 | my $UNSUPPORTED_DISAPPEARS= "UNSUPPORTED disappears [UNSUP=> ]"; |
| 70 | my $UNSUPPORTED_APPEARS = "UNSUPPORTED appears [ =>UNSUP]"; |
| 71 | |
| 72 | my $UNTESTED_PASS = "UNTESTED now PASS [UNTES=> PASS]"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 73 | my $UNTESTED_XPASS = "UNTESTED now XPASS [UNTES=>XPASS]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 74 | my $UNTESTED_FAIL = "UNTESTED now FAIL [UNTES=> FAIL]"; |
| 75 | my $UNTESTED_XFAIL = "UNTESTED now XFAIL [UNTES=>XFAIL]"; |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 76 | my $UNTESTED_UNSUPPORTED = "UNTESTED now UNSUPP [UNTES=>UNSUP]"; |
| 77 | my $UNTESTED_UNRESOLVED = "UNTESTED now UNRESOLVED [UNTES=>UNRES]"; |
| 78 | my $UNTESTED_UNTESTED = "UNTESTED now UNTESTED [UNTES=>UNTES]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 79 | my $UNTESTED_DISAPPEARS = "UNTESTED disappears [UNTES=> ]"; |
| 80 | my $UNTESTED_APPEARS = "UNTESTED appears [ =>UNTES]"; |
| 81 | |
| 82 | my $UNRESOLVED_PASS = "UNRESOLVED now PASS [UNRES=> PASS]"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 83 | my $UNRESOLVED_XPASS = "UNRESOLVED now XPASS [UNRES=>XPASS]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 84 | my $UNRESOLVED_FAIL = "UNRESOLVED now FAIL [UNRES=> FAIL]"; |
| 85 | my $UNRESOLVED_XFAIL = "UNRESOLVED now XFAIL [UNRES=>XFAIL]"; |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 86 | my $UNRESOLVED_UNSUPPORTED= "UNRESOLVED now UNSUPP [UNRES=>UNSUP]"; |
| 87 | my $UNRESOLVED_UNRESOLVED = "UNRESOLVED now UNRESOLVED [UNRES=>UNRES]"; |
| 88 | my $UNRESOLVED_UNTESTED = "UNRESOLVED now UNTESTED [UNRES=>UNTES]"; |
Christophe Lyon | 71cec96 | 2016-06-28 18:27:30 +0200 | [diff] [blame] | 89 | my $UNRESOLVED_DISAPPEARS = "UNRESOLVED disappears [UNRES=> ]"; |
| 90 | my $UNRESOLVED_APPEARS = "UNRESOLVED appears [ =>UNRES]"; |
| 91 | |
| 92 | my $UNHANDLED_CASES = "Unhandled cases [ ..??.. ]"; |
| 93 | my $UNSTABLE_CASES = "Unstable cases, ignored [~RANDOM ]"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 94 | |
| 95 | my @handler_list = ( |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 96 | {was=>"PASS", is=>"PASS", cat=>$PASS_PASS}, |
| 97 | {was=>"PASS", is=>"XPASS", cat=>$PASS_XPASS}, |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 98 | {was=>"PASS", is=>"FAIL", handler=>\&handle_pass_fail}, |
| 99 | {was=>"PASS", is=>"XFAIL", cat=>$PASS_XFAIL}, |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 100 | {was=>"PASS", is=>"UNSUPPORTED",cat=>$PASS_UNSUPPORTED}, |
| 101 | {was=>"PASS", is=>"UNTESTED", cat=>$PASS_UNTESTED}, |
| 102 | {was=>"PASS", is=>"UNRESOLVED",cat=>$PASS_UNRESOLVED}, |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 103 | {was=>"PASS", is=>"NO_EXIST", cat=>$PASS_DISAPPEARS}, |
| 104 | {was=>"NO_EXIST", is=>"PASS", cat=>$PASS_APPEARS}, |
| 105 | |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 106 | {was=>"XPASS", is=>"PASS", cat=>$XPASS_PASS}, |
| 107 | {was=>"XPASS", is=>"XPASS", cat=>$XPASS_XPASS}, |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 108 | {was=>"XPASS", is=>"FAIL", cat=>$XPASS_FAIL}, |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 109 | {was=>"XPASS", is=>"XFAIL", cat=>$XPASS_XFAIL}, |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 110 | {was=>"XPASS", is=>"UNSUPPORTED",cat=>$XPASS_UNSUPPORTED}, |
| 111 | {was=>"XPASS", is=>"UNTESTED", cat=>$XPASS_UNTESTED}, |
| 112 | {was=>"XPASS", is=>"UNRESOLVED",cat=>$XPASS_UNRESOLVED}, |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 113 | {was=>"XPASS", is=>"NO_EXIST", cat=>$XPASS_DISAPPEARS}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 114 | {was=>"NO_EXIST", is=>"XPASS", cat=>$XPASS_APPEARS}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 115 | |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 116 | {was=>"FAIL", is=>"PASS", cat=>$FAIL_PASS}, |
| 117 | {was=>"FAIL", is=>"XPASS", cat=>$FAIL_XPASS}, |
| 118 | {was=>"FAIL", is=>"FAIL", cat=>$FAIL_FAIL}, |
| 119 | {was=>"FAIL", is=>"XFAIL", cat=>$FAIL_XFAIL}, |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 120 | {was=>"FAIL", is=>"UNSUPPORTED",cat=>$FAIL_UNSUPPORTED}, |
| 121 | {was=>"FAIL", is=>"UNTESTED", cat=>$FAIL_UNTESTED}, |
| 122 | {was=>"FAIL", is=>"UNRESOLVED",cat=>$FAIL_UNRESOLVED}, |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 123 | {was=>"FAIL", is=>"NO_EXIST", cat=>$FAIL_DISAPPEARS}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 124 | {was=>"NO_EXIST", is=>"FAIL", cat=>$FAIL_APPEARS}, |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 125 | |
| 126 | {was=>"XFAIL", is=>"PASS", cat=>$XFAIL_PASS}, |
| 127 | {was=>"XFAIL", is=>"XPASS", cat=>$XFAIL_XPASS}, |
| 128 | {was=>"XFAIL", is=>"FAIL", cat=>$XFAIL_FAIL}, |
| 129 | {was=>"XFAIL", is=>"XFAIL", cat=>$XFAIL_XFAIL}, |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 130 | {was=>"XFAIL", is=>"UNSUPPORTED",cat=>$XFAIL_UNSUPPORTED}, |
| 131 | {was=>"XFAIL", is=>"UNTESTED", cat=>$XFAIL_UNTESTED}, |
| 132 | {was=>"XFAIL", is=>"UNRESOLVED",cat=>$XFAIL_UNRESOLVED}, |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 133 | {was=>"XFAIL", is=>"NO_EXIST", cat=>$XFAIL_DISAPPEARS}, |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 134 | {was=>"NO_EXIST", is=>"XFAIL", cat=>$XFAIL_APPEARS}, |
| 135 | |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 136 | {was=>"UNSUPPORTED", is=>"PASS", cat=>$UNSUPPORTED_PASS}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 137 | {was=>"UNSUPPORTED", is=>"XPASS", cat=>$UNSUPPORTED_XPASS}, |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 138 | {was=>"UNSUPPORTED", is=>"FAIL", cat=>$UNSUPPORTED_FAIL}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 139 | {was=>"UNSUPPORTED", is=>"XFAIL", cat=>$UNSUPPORTED_XFAIL}, |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 140 | {was=>"UNSUPPORTED", is=>"UNSUPPORTED",cat=>$UNSUPPORTED_UNSUPPORTED}, |
| 141 | {was=>"UNSUPPORTED", is=>"UNTESTED", cat=>$UNSUPPORTED_UNTESTED}, |
| 142 | {was=>"UNSUPPORTED", is=>"UNRESOLVED",cat=>$UNSUPPORTED_UNRESOLVED}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 143 | {was=>"UNSUPPORTED", is=>"NO_EXIST", cat=>$UNSUPPORTED_DISAPPEARS}, |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 144 | {was=>"NO_EXIST", is=>"UNSUPPORTED", cat=>$UNSUPPORTED_APPEARS}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 145 | |
| 146 | {was=>"UNTESTED", is=>"PASS", cat=>$UNTESTED_PASS}, |
| 147 | {was=>"UNTESTED", is=>"XPASS", cat=>$UNTESTED_XPASS}, |
| 148 | {was=>"UNTESTED", is=>"FAIL", cat=>$UNTESTED_FAIL}, |
| 149 | {was=>"UNTESTED", is=>"XFAIL", cat=>$UNTESTED_XFAIL}, |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 150 | {was=>"UNTESTED", is=>"UNSUPPORTED",cat=>$UNTESTED_UNSUPPORTED}, |
| 151 | {was=>"UNTESTED", is=>"UNTESTED", cat=>$UNTESTED_UNTESTED}, |
| 152 | {was=>"UNTESTED", is=>"UNRESOLVED",cat=>$UNTESTED_UNRESOLVED}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 153 | {was=>"UNTESTED", is=>"NO_EXIST", cat=>$UNTESTED_DISAPPEARS}, |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 154 | {was=>"NO_EXIST", is=>"UNTESTED", cat=>$UNTESTED_APPEARS}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 155 | |
| 156 | {was=>"UNRESOLVED", is=>"PASS", cat=>$UNRESOLVED_PASS}, |
| 157 | {was=>"UNRESOLVED", is=>"XPASS", cat=>$UNRESOLVED_XPASS}, |
| 158 | {was=>"UNRESOLVED", is=>"FAIL", cat=>$UNRESOLVED_FAIL}, |
| 159 | {was=>"UNRESOLVED", is=>"XFAIL", cat=>$UNRESOLVED_XFAIL}, |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 160 | {was=>"UNRESOLVED", is=>"UNSUPPORTED",cat=>$UNRESOLVED_UNSUPPORTED}, |
| 161 | {was=>"UNRESOLVED", is=>"UNTESTED", cat=>$UNRESOLVED_UNTESTED}, |
| 162 | {was=>"UNRESOLVED", is=>"UNRESOLVED",cat=>$UNRESOLVED_UNRESOLVED}, |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 163 | {was=>"UNRESOLVED", is=>"NO_EXIST", cat=>$UNRESOLVED_DISAPPEARS}, |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 164 | {was=>"NO_EXIST", is=>"UNRESOLVED", cat=>$UNRESOLVED_APPEARS}, |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 165 | |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 166 | # {was=>"NO_EXIST", is=>"NO_EXIST", handler=>\&handle_not_yet_supported} |
| 167 | ); |
| 168 | |
| 169 | ###################################################### |
| 170 | # TREAT ARGUMENTS |
| 171 | |
| 172 | my $verbose=0; |
| 173 | my $quiet=0; |
| 174 | my $long=0; |
| 175 | my $short=0; |
| 176 | my $debug=0; |
| 177 | my ($testroot, $basename); |
| 178 | my ($ref_file_name, $res_file_name); |
| 179 | my $nounstable=0; |
| 180 | my $unstablefile=0; |
| 181 | my @unstable_markers=(); |
| 182 | |
| 183 | GetOptions ("l" => \$long, |
| 184 | "s" => \$short, |
| 185 | "q" => \$quiet, |
| 186 | "v" => \$verbose, |
| 187 | "dbg" => \$debug, |
| 188 | "testroot=s" => \$testroot, |
| 189 | "basename=s" => \$basename, |
| 190 | "no-unstable" => \$nounstable, |
| 191 | "unstable-tests=s" => \$unstablefile, |
| 192 | "unstable-marker=s" => \@unstable_markers); |
| 193 | |
| 194 | $ref_file_name = $ARGV[0] if ($#ARGV == 1); |
| 195 | $res_file_name = $ARGV[1] if ($#ARGV == 1); |
| 196 | |
| 197 | $ref_file_name = $testroot."/expected_results/".$basename if ($testroot and $basename); |
| 198 | $res_file_name = $testroot."/testing/run/".$basename if ($testroot and $basename); |
| 199 | &usage if (not $ref_file_name or not $res_file_name); |
| 200 | |
| 201 | my ($col_boldred, $col_red, $col_boldgreen, $col_green, $col_boldpink, $col_pink, $col_reset) |
| 202 | = ("\033[31;1m","\033[31;3m","\033[32;1m","\033[32;3m","\033[35;1m","\033[35;2m","\033[0m"); |
| 203 | ($col_boldred, $col_red, $col_boldgreen, $col_green, $col_boldpink, $col_pink, $col_reset) |
| 204 | = ("","","","","","","") if (not I_am_interactive()); |
| 205 | |
| 206 | ###################################################### |
| 207 | # MAIN PROGRAM |
| 208 | # print "comparing $ref_file_name $res_file_name\n"; |
| 209 | |
| 210 | # If none of the 2 .sum exists, nothing to compare: exit early. |
| 211 | exit 0 if ( (! -e $ref_file_name) && (! -e $res_file_name )); |
| 212 | |
| 213 | my $ref = read_sum($ref_file_name) ; |
| 214 | my $res = read_sum($res_file_name) ; |
| 215 | my @unstablelist = (); |
| 216 | |
| 217 | @unstablelist = read_unstable($unstablefile) if ($unstablefile ne 0); |
| 218 | |
| 219 | compare_results($ref, $res); |
| 220 | |
| 221 | my $final_result = print_compare_results_summary($ref, $res); |
| 222 | |
| 223 | exit $final_result; |
| 224 | |
| 225 | ###################################################### |
| 226 | # UTILITIES |
| 227 | |
| 228 | sub empty_result() |
| 229 | { |
| 230 | my %empty_result;# = {PASS=>0, FAIL=>0, XPASS=>0, XFAIL=>0, UNSUPPORTED=>0, UNTESTED=>0, UNRESOLVED=>0}; |
| 231 | $empty_result{PASS}=$empty_result{FAIL}=$empty_result{XPASS}=$empty_result{XFAIL}=0; |
| 232 | $empty_result{UNSUPPORTED}=$empty_result{UNTESTED}=$empty_result{UNRESOLVED}=$empty_result{NO_EXIST}=0; |
| 233 | return \%empty_result; |
| 234 | } |
| 235 | sub I_am_interactive { |
| 236 | return -t STDIN && -t STDOUT; |
| 237 | } |
| 238 | sub usage() |
| 239 | { |
| 240 | print "Usage : $app <ref_file.sum> <result_file.sum>\n"; |
| 241 | exit 1; |
| 242 | } |
| 243 | |
| 244 | |
| 245 | ###################################################### |
| 246 | # PARSING |
| 247 | sub read_sum($) |
| 248 | { |
| 249 | my ($sum_file) = @_; |
| 250 | my $res = empty_result(); |
| 251 | my %testcases; |
| 252 | my %unsupported; |
| 253 | $res->{testcases} = \%testcases; |
| 254 | my $pending_timeout=0; |
| 255 | |
Christophe Lyon | ad8c724 | 2016-02-03 13:04:28 +0100 | [diff] [blame] | 256 | $res->{EXEC}->{PASS} = 0; |
| 257 | $res->{EXEC}->{FAIL} = 0; |
| 258 | |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 259 | open SUMFILE, $sum_file or die $!; |
| 260 | while (<SUMFILE>) |
| 261 | { |
| 262 | if (m/^(PASS|XPASS|FAIL|XFAIL|UNSUPPORTED|UNTESTED|UNRESOLVED): (.*)/) |
| 263 | { |
| 264 | my ($diag,$tc) = ($1,$2); |
| 265 | my %tcresult; |
| 266 | $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./; |
| 267 | $testcases{$tc} = empty_result() if (not exists $testcases{$tc}); |
| 268 | $testcases{$tc}->{$diag}++; |
| 269 | $testcases{$tc}->{HAS_TIMED_OUT} = $pending_timeout; |
| 270 | $pending_timeout = 0; |
| 271 | $res->{$diag}++; |
Christophe Lyon | ad8c724 | 2016-02-03 13:04:28 +0100 | [diff] [blame] | 272 | # Count execution tests, for a sanity check |
| 273 | if ($tc =~ /execution/) |
| 274 | { |
| 275 | $res->{EXEC}->{$diag}++; |
| 276 | } |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 277 | } |
| 278 | elsif (m/WARNING: program timed out/) |
| 279 | { |
| 280 | $pending_timeout = 1; |
| 281 | } |
| 282 | elsif (m/^(# of expected passes|# of unexpected failures|# of expected failures|# of known failures|# of unsupported tests|# of untested testcases)\s+(.*)/) |
| 283 | { |
| 284 | $res->{"summary - "."$1"} = $2; |
| 285 | } |
| 286 | elsif (m/^\/.*\/([^\/]+)\s+version\s+(.*)/) |
| 287 | { |
| 288 | $res->{tool} = $1; |
| 289 | $res->{version} = $2; |
| 290 | $res->{version} =~ s/ [-(].*//; |
| 291 | } |
| 292 | } |
| 293 | close SUMFILE; |
| 294 | return $res; |
| 295 | } |
| 296 | |
| 297 | # Parse list on unstable tests |
| 298 | sub read_unstable($) |
| 299 | { |
| 300 | my ($unstable_file) = @_; |
| 301 | my @unstable_tests = (); |
| 302 | |
| 303 | open UNSTABLEFILE, $unstable_file or die $!; |
| 304 | while (<UNSTABLEFILE>) |
| 305 | { |
| 306 | # Skip lines starting with '#', or with spaces only |
| 307 | if ((/^#/) || (/^[ ]*$/)) |
| 308 | { |
| 309 | } |
| 310 | else |
| 311 | { |
| 312 | chomp; |
| 313 | |
| 314 | my $test = $_; |
| 315 | |
| 316 | # Check if line is of type: target:testname |
Christophe Lyon | 5e7241c | 2015-12-04 12:57:27 +0100 | [diff] [blame] | 317 | if (/^(.*?):/) |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 318 | { |
| 319 | foreach my $unstable_marker (@unstable_markers) |
| 320 | { |
| 321 | if ($unstable_marker eq $1) { |
| 322 | # If target matches the one supplied as script |
| 323 | # argument, add the testname to the list |
Christophe Lyon | 5e7241c | 2015-12-04 12:57:27 +0100 | [diff] [blame] | 324 | $test =~ s/.*?://; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 325 | push @unstable_tests, $test; |
| 326 | } |
| 327 | } |
| 328 | } else { |
| 329 | push @unstable_tests, $test; |
| 330 | } |
| 331 | } |
| 332 | } |
| 333 | close UNSTABLEFILE; |
| 334 | return @unstable_tests; |
| 335 | } |
| 336 | |
| 337 | ###################################################### |
| 338 | # DIFFING |
| 339 | sub handle_pass_fail($$$$) |
| 340 | { |
| 341 | my ($ref, $res, $diag_diag, $tc) = @_; |
| 342 | if ($res->{testcases}->{$tc}->{HAS_TIMED_OUT}) |
| 343 | { |
| 344 | push @{$res->{$PASSED_NOW_TIMEOUTS}}, $tc; |
| 345 | } |
| 346 | else |
| 347 | { |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 348 | push @{$res->{$PASS_FAIL}}, $tc; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 349 | } |
| 350 | } |
| 351 | |
| 352 | sub compare_results($$) |
| 353 | { |
| 354 | my ($ref, $res) = @_; |
| 355 | |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 356 | @{$res->{$PASS_PASS}} = (); |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 357 | @{$res->{$PASS_XPASS}} = (); |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 358 | @{$res->{$PASS_FAIL}} = (); |
| 359 | @{$res->{$PASS_XFAIL}} = (); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 360 | @{$res->{$PASS_UNSUPPORTED}} = (); |
| 361 | @{$res->{$PASS_UNTESTED}} = (); |
| 362 | @{$res->{$PASS_UNRESOLVED}} = (); |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 363 | @{$res->{$PASS_DISAPPEARS}} = (); |
| 364 | @{$res->{$PASS_APPEARS}} = (); |
| 365 | @{$res->{$PASSED_NOW_TIMEOUTS}} = (); |
| 366 | |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 367 | @{$res->{$XPASS_PASS}} = (); |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 368 | @{$res->{$XPASS_XPASS}} = (); |
| 369 | @{$res->{$XPASS_FAIL}} = (); |
| 370 | @{$res->{$XPASS_XFAIL}} = (); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 371 | @{$res->{$XPASS_UNSUPPORTED}} = (); |
| 372 | @{$res->{$XPASS_UNTESTED}} = (); |
| 373 | @{$res->{$XPASS_UNRESOLVED}} = (); |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 374 | @{$res->{$XPASS_DISAPPEARS}} = (); |
| 375 | @{$res->{$XPASS_APPEARS}} = (); |
| 376 | |
| 377 | @{$res->{$FAIL_PASS}} = (); |
| 378 | @{$res->{$FAIL_XPASS}} = (); |
| 379 | @{$res->{$FAIL_FAIL}} = (); |
| 380 | @{$res->{$FAIL_XFAIL}} = (); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 381 | @{$res->{$FAIL_UNSUPPORTED}} = (); |
| 382 | @{$res->{$FAIL_UNTESTED}} = (); |
| 383 | @{$res->{$FAIL_UNRESOLVED}} = (); |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 384 | @{$res->{$FAIL_DISAPPEARS}} = (); |
| 385 | @{$res->{$FAIL_APPEARS}} = (); |
| 386 | |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 387 | @{$res->{$XFAIL_PASS}} = (); |
| 388 | @{$res->{$XFAIL_XPASS}} = (); |
| 389 | @{$res->{$XFAIL_FAIL}} = (); |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 390 | @{$res->{$XFAIL_XFAIL}} = (); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 391 | @{$res->{$XFAIL_UNSUPPORTED}} = (); |
| 392 | @{$res->{$XFAIL_UNTESTED}} = (); |
| 393 | @{$res->{$XFAIL_UNRESOLVED}} = (); |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 394 | @{$res->{$XFAIL_DISAPPEARS}} = (); |
| 395 | @{$res->{$XFAIL_APPEARS}} = (); |
| 396 | |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 397 | @{$res->{$UNSUPPORTED_PASS}} = (); |
| 398 | @{$res->{$UNSUPPORTED_XPASS}} = (); |
| 399 | @{$res->{$UNSUPPORTED_FAIL}} = (); |
| 400 | @{$res->{$UNSUPPORTED_XFAIL}} = (); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 401 | @{$res->{$UNSUPPORTED_UNSUPPORTED}} = (); |
| 402 | @{$res->{$UNSUPPORTED_UNTESTED}} = (); |
| 403 | @{$res->{$UNSUPPORTED_UNRESOLVED}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 404 | @{$res->{$UNSUPPORTED_DISAPPEARS}} = (); |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 405 | @{$res->{$UNSUPPORTED_APPEARS}} = (); |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 406 | |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 407 | @{$res->{$UNTESTED_PASS}} = (); |
| 408 | @{$res->{$UNTESTED_XPASS}} = (); |
| 409 | @{$res->{$UNTESTED_FAIL}} = (); |
| 410 | @{$res->{$UNTESTED_XFAIL}} = (); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 411 | @{$res->{$UNTESTED_UNSUPPORTED}} = (); |
| 412 | @{$res->{$UNTESTED_UNTESTED}} = (); |
| 413 | @{$res->{$UNTESTED_UNRESOLVED}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 414 | @{$res->{$UNTESTED_DISAPPEARS}} = (); |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 415 | @{$res->{$UNTESTED_APPEARS}} = (); |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 416 | |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 417 | @{$res->{$UNRESOLVED_PASS}} = (); |
| 418 | @{$res->{$UNRESOLVED_XPASS}} = (); |
| 419 | @{$res->{$UNRESOLVED_FAIL}} = (); |
| 420 | @{$res->{$UNRESOLVED_XFAIL}} = (); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 421 | @{$res->{$UNRESOLVED_UNSUPPORTED}} = (); |
| 422 | @{$res->{$UNRESOLVED_UNTESTED}} = (); |
| 423 | @{$res->{$UNRESOLVED_UNRESOLVED}} = (); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 424 | @{$res->{$UNRESOLVED_DISAPPEARS}} = (); |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 425 | @{$res->{$UNRESOLVED_APPEARS}} = (); |
Christophe Lyon | fdfbd17 | 2016-06-28 18:38:55 +0200 | [diff] [blame] | 426 | |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 427 | @{$res->{$UNHANDLED_CASES}} = (); |
| 428 | @{$res->{$UNSTABLE_CASES}} = (); |
| 429 | |
| 430 | #### MERGE REF AND RES |
| 431 | foreach my $key (sort (keys %{$res->{testcases}})) |
| 432 | { |
| 433 | if (not exists $ref->{testcases}->{$key}) { |
| 434 | $ref->{testcases}->{$key} = empty_result(); |
| 435 | $ref->{testcases}->{$key}->{NO_EXIST} = 1; |
| 436 | } |
| 437 | } |
| 438 | foreach my $key (keys %{$ref->{testcases}}) |
| 439 | { |
| 440 | if (not exists $res->{testcases}->{$key}) |
| 441 | { |
| 442 | $res->{testcases}->{$key} = empty_result(); |
| 443 | $res->{testcases}->{$key}->{NO_EXIST} = 1; |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | #### ACTIONS FOR EACH CASES |
| 448 | my %unstable_found; |
| 449 | |
| 450 | foreach my $key (sort (keys %{$ref->{testcases}})) |
| 451 | { |
| 452 | foreach my $diag_diag (@handler_list) |
| 453 | { |
| 454 | if ($ref->{testcases}->{$key}->{$diag_diag->{was}} != $res->{testcases}->{$key}->{$diag_diag->{was}} |
| 455 | and $res->{testcases}->{$key}->{$diag_diag->{is}}) |
| 456 | { |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 457 | print "$key ref was:$ref->{testcases}->{$key}->{$diag_diag->{was}}, res was:$res->{testcases}->{$key}->{$diag_diag->{was}}, res is:$res->{testcases}->{$key}->{$diag_diag->{is}} \n" if ($debug); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 458 | # If testcase is listed as 'unstable' mark it as |
| 459 | # such and skip other processing. |
| 460 | { |
| 461 | if (grep { (index $key,$_)!=-1} @unstablelist) |
| 462 | { |
| 463 | print "[unstable] $key\n" if ($debug); |
| 464 | $unstable_found{$key}=1; |
| 465 | } |
| 466 | else { |
| 467 | print "[$diag_diag->{was} => $diag_diag->{is}] $key\n" if ($debug); |
| 468 | if ($diag_diag->{handler}) |
| 469 | { |
| 470 | $diag_diag->{handler} ($ref, $res, $diag_diag, $key); |
| 471 | } |
| 472 | else |
| 473 | { |
| 474 | push @{$res->{$diag_diag->{cat}}}, $key; |
| 475 | } |
| 476 | } |
| 477 | } |
| 478 | } |
| 479 | } |
| 480 | } |
| 481 | push @{$res->{$UNSTABLE_CASES}}, (sort (keys (%unstable_found))) if ($nounstable == 0); |
| 482 | |
| 483 | } |
| 484 | |
| 485 | ###################################################### |
| 486 | # PRINTING |
| 487 | sub print_tclist($@) |
| 488 | { |
| 489 | my ($cat, @tclist) = @_; |
| 490 | print " - ".$cat.":\n\n ". join("\n ",@tclist) . "\n\n" if (scalar(@tclist)); |
| 491 | } |
| 492 | |
| 493 | sub print_compare_results_summary($$) |
| 494 | { |
| 495 | my ($ref, $res) = @_; |
| 496 | my $return_value=0; |
Christophe Lyon | f5aeb34 | 2015-12-08 14:47:16 +0100 | [diff] [blame] | 497 | my $total_better = 0; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 498 | my $rtotal = 0; |
| 499 | my $quiet_reg = $quiet; |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame] | 500 | my $ref_ratio = 0; |
Christophe Lyon | 0ab7d35 | 2016-04-06 10:39:58 +0200 | [diff] [blame] | 501 | my $ref_total = 0; |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame] | 502 | my $res_ratio = 0; |
Christophe Lyon | 0ab7d35 | 2016-04-06 10:39:58 +0200 | [diff] [blame] | 503 | my $res_total = 0; |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame] | 504 | my $ratio_thresh = 0.95; # Warn if pass ratio is below this threshold |
Christophe Lyon | ad8c724 | 2016-02-03 13:04:28 +0100 | [diff] [blame] | 505 | my $ignore_exec = 0; |
| 506 | my $ref_has_exec_tests = 0; |
| 507 | my $res_has_exec_tests = 0; |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame] | 508 | |
| 509 | # Compute the pass ratio as a sanity check |
Christophe Lyon | 0ab7d35 | 2016-04-06 10:39:58 +0200 | [diff] [blame] | 510 | $ref_total = $ref->{PASS} + |
| 511 | $ref->{XFAIL} + |
| 512 | $ref->{XPASS} + |
| 513 | $ref->{FAIL} + |
| 514 | $ref->{UNRESOLVED} + |
| 515 | $ref->{UNSUPPORTED} + |
| 516 | $ref->{UNTESTED}; |
| 517 | |
| 518 | # It is possible that no test is executed at all (for instance if |
| 519 | # RUNTESTFLAGS was too restrictive). Avoid division by 0. |
| 520 | if ($ref_total > 0) { |
| 521 | $ref_ratio = ($ref->{PASS} + $ref->{XFAIL}) / |
| 522 | $ref_total; |
| 523 | } |
| 524 | |
| 525 | $res_total = $res->{PASS} + |
| 526 | $res->{XFAIL} + |
| 527 | $res->{XPASS} + |
| 528 | $res->{FAIL} + |
| 529 | $res->{UNRESOLVED} + |
| 530 | $res->{UNSUPPORTED} + |
| 531 | $res->{UNTESTED}; |
| 532 | |
| 533 | if ($res_total > 0) { |
| 534 | $res_ratio = ($res->{PASS} + $res->{XFAIL}) / |
| 535 | $res_total; |
| 536 | } |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 537 | |
| 538 | if (not $quiet) |
| 539 | { |
| 540 | printf "Comparing:\n"; |
| 541 | printf "REFERENCE:$ref_file_name\n"; |
| 542 | printf "CURRENT: $res_file_name\n\n"; |
| 543 | } |
| 544 | |
| 545 | #### TESTS STATUS |
| 546 | if (not $quiet and not $short) |
| 547 | { |
| 548 | printf " ` +---------+---------+\n"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 549 | printf "o RUN STATUS: | REF | RES |\n"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 550 | printf " +------------------------------------------+---------+---------+\n"; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 551 | printf " | %-40s | %7d | %7d |\n", "Passes [PASS]", $ref->{PASS}, $res->{PASS}; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 552 | printf " | %-40s | %7d | %7d |\n", "Unexpected fails [FAIL]", $ref->{FAIL}, $res->{FAIL}; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 553 | printf " | %-40s | %7d | %7d |\n", "Unexpected passes [XPASS]", $ref->{XPASS}, $res->{XPASS}; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 554 | printf " | %-40s | %7d | %7d |\n", "Expected fails [XFAIL]", $ref->{XFAIL}, $res->{XFAIL}; |
| 555 | printf " | %-40s | %7d | %7d |\n", "Unresolved [UNRESOLVED]", $ref->{UNRESOLVED}, $res->{UNRESOLVED}; |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 556 | printf " | %-40s | %7d | %7d |\n", "Unsupported [UNSUPPORTED]", $ref->{UNSUPPORTED}, $res->{UNSUPPORTED}; |
| 557 | printf " | %-40s | %7d | %7d |\n", "Untested [UNTESTED]", $ref->{UNTESTED}, $res->{UNTESTED}; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 558 | printf " +------------------------------------------+---------+---------+\n"; |
| 559 | printf "\n"; |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame] | 560 | |
Christophe Lyon | 3d195c2 | 2016-04-06 16:00:25 +0200 | [diff] [blame] | 561 | printf " REF PASS ratio: %f\n", $ref_ratio; |
| 562 | printf " RES PASS ratio: %f\n", $res_ratio; |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame] | 563 | if ($ref_ratio < $ratio_thresh) |
| 564 | { |
Christophe Lyon | 1176f96 | 2016-03-03 18:01:10 +0100 | [diff] [blame] | 565 | printf " ***** ERROR: REF PASS ratio is abnormally low *****\n"; |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame] | 566 | } |
| 567 | if ($res_ratio < $ratio_thresh) |
| 568 | { |
Christophe Lyon | 1176f96 | 2016-03-03 18:01:10 +0100 | [diff] [blame] | 569 | printf " ***** ERROR: RES PASS ratio is abnormally low *****\n"; |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame] | 570 | } |
| 571 | |
Christophe Lyon | ad8c724 | 2016-02-03 13:04:28 +0100 | [diff] [blame] | 572 | # If both PASS and FAIL EXEC tests are zero, assume there is no |
| 573 | # execution test for this tool, and do not warn. |
| 574 | $ref_has_exec_tests = ($ref->{EXEC}->{PASS} + $ref->{EXEC}->{FAIL}) != 0; |
| 575 | if ($ref_has_exec_tests) |
| 576 | { |
| 577 | printf " ***** ERROR: No REF execution test PASSed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{PASS} == 0); |
| 578 | printf " ***** WARNING: No REF execution test FAILed. Check execution engine configuration. *****\n" if ($ref->{EXEC}->{FAIL} == 0); |
| 579 | } |
| 580 | |
| 581 | $res_has_exec_tests = ($res->{EXEC}->{PASS} + $res->{EXEC}->{FAIL}) != 0; |
| 582 | if ($res_has_exec_tests) |
| 583 | { |
| 584 | printf " ***** ERROR: No RES execution test PASSed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{PASS} == 0); |
| 585 | printf " ***** WARNING: No RES execution test FAILed. Check execution engine configuration. *****\n" if ($res->{EXEC}->{FAIL} == 0); |
| 586 | } |
| 587 | |
| 588 | # Ignore number of execution tests when computing the return |
| 589 | # value, if both REF and RES have no execution test. |
| 590 | $ignore_exec = !$ref_has_exec_tests && !$res_has_exec_tests; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 591 | } |
| 592 | |
| 593 | #### REGRESSIONS ? |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 594 | $rtotal = scalar(@{$res->{$PASS_XPASS}}) |
| 595 | +scalar(@{$res->{$PASS_FAIL}}) |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 596 | +scalar(@{$res->{$PASS_UNRESOLVED}}) |
| 597 | +scalar(@{$res->{$PASSED_NOW_TIMEOUTS}}) |
| 598 | +scalar(@{$res->{$XPASS_FAIL}}) |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 599 | +scalar(@{$res->{$XPASS_APPEARS}}) |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 600 | +scalar(@{$res->{$XPASS_UNRESOLVED}}) |
| 601 | +scalar(@{$res->{$FAIL_APPEARS}}) |
| 602 | +scalar(@{$res->{$FAIL_UNRESOLVED}}) |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 603 | +scalar(@{$res->{$XFAIL_FAIL}}) |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 604 | +scalar(@{$res->{$XFAIL_DISAPPEARS}}) |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 605 | +scalar(@{$res->{$XFAIL_UNRESOLVED}}) |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 606 | +scalar(@{$res->{$UNSUPPORTED_FAIL}}) |
| 607 | +scalar(@{$res->{$UNSUPPORTED_XPASS}}) |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 608 | +scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}) |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 609 | +scalar(@{$res->{$UNTESTED_FAIL}}) |
| 610 | +scalar(@{$res->{$UNTESTED_XPASS}}) |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 611 | +scalar(@{$res->{$UNTESTED_UNRESOLVED}}) |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 612 | +scalar(@{$res->{$UNRESOLVED_FAIL}}) |
| 613 | +scalar(@{$res->{$UNRESOLVED_XPASS}}) |
Christophe Lyon | 31279df | 2016-07-04 17:02:12 +0200 | [diff] [blame^] | 614 | +scalar(@{$res->{$UNRESOLVED_APPEARS}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 615 | |
| 616 | $quiet_reg=1 if ($short and not $rtotal); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 617 | |
| 618 | if (not $quiet_reg) |
| 619 | { |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 620 | printf "\n$col_red"."o REGRESSIONS:\n"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 621 | printf " +------------------------------------------+---------+\n"; |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 622 | printf " | %-40s | %7d |\n", $PASS_XPASS, scalar(@{$res->{$PASS_XPASS}}) if (scalar(@{$res->{$PASS_XPASS}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 623 | printf " | %-40s | %7d |\n", $PASS_FAIL, scalar(@{$res->{$PASS_FAIL}}) if (scalar(@{$res->{$PASS_FAIL}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 624 | printf " | %-40s | %7d |\n", $PASS_UNRESOLVED, scalar(@{$res->{$PASS_UNRESOLVED}}) if (scalar(@{$res->{$PASS_UNRESOLVED}})); |
| 625 | printf " | %-40s | %7d |\n", $PASSED_NOW_TIMEOUTS, scalar(@{$res->{$PASSED_NOW_TIMEOUTS}}) if (scalar(@{$res->{$PASSED_NOW_TIMEOUTS}})); |
| 626 | printf " | %-40s | %7d |\n", $XPASS_FAIL, scalar(@{$res->{$XPASS_FAIL}}) if (scalar(@{$res->{$XPASS_FAIL}})); |
| 627 | printf " | %-40s | %7d |\n", $XPASS_APPEARS, scalar(@{$res->{$XPASS_APPEARS}}) if (scalar(@{$res->{$XPASS_APPEARS}})); |
| 628 | printf " | %-40s | %7d |\n", $XPASS_UNRESOLVED, scalar(@{$res->{$XPASS_UNRESOLVED}}) if (scalar(@{$res->{$XPASS_UNRESOLVED}})); |
| 629 | printf " | %-40s | %7d |\n", $FAIL_APPEARS, scalar(@{$res->{$FAIL_APPEARS}}) if (scalar(@{$res->{$FAIL_APPEARS}})); |
| 630 | printf " | %-40s | %7d |\n", $FAIL_UNRESOLVED, scalar(@{$res->{$FAIL_UNRESOLVED}}) if (scalar(@{$res->{$FAIL_UNRESOLVED}})); |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 631 | printf " | %-40s | %7d |\n", $XFAIL_FAIL, scalar(@{$res->{$XFAIL_FAIL}}) if (scalar(@{$res->{$XFAIL_FAIL}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 632 | printf " | %-40s | %7d |\n", $XFAIL_DISAPPEARS, scalar(@{$res->{$XFAIL_DISAPPEARS}}) if (scalar(@{$res->{$XFAIL_DISAPPEARS}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 633 | printf " | %-40s | %7d |\n", $XFAIL_UNRESOLVED, scalar(@{$res->{$XFAIL_UNRESOLVED}}) if (scalar(@{$res->{$XFAIL_UNRESOLVED}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 634 | printf " | %-40s | %7d |\n", $UNSUPPORTED_FAIL, scalar(@{$res->{$UNSUPPORTED_FAIL}}) if (scalar(@{$res->{$UNSUPPORTED_FAIL}})); |
| 635 | printf " | %-40s | %7d |\n", $UNSUPPORTED_XPASS, scalar(@{$res->{$UNSUPPORTED_XPASS}}) if (scalar(@{$res->{$UNSUPPORTED_XPASS}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 636 | printf " | %-40s | %7d |\n", $UNSUPPORTED_UNRESOLVED, scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}}) if (scalar(@{$res->{$UNSUPPORTED_UNRESOLVED}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 637 | printf " | %-40s | %7d |\n", $UNTESTED_FAIL, scalar(@{$res->{$UNTESTED_FAIL}}) if (scalar(@{$res->{$UNTESTED_FAIL}})); |
| 638 | printf " | %-40s | %7d |\n", $UNTESTED_XPASS, scalar(@{$res->{$UNTESTED_XPASS}}) if (scalar(@{$res->{$UNTESTED_XPASS}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 639 | printf " | %-40s | %7d |\n", $UNTESTED_UNRESOLVED, scalar(@{$res->{$UNTESTED_UNRESOLVED}}) if (scalar(@{$res->{$UNTESTED_UNRESOLVED}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 640 | printf " | %-40s | %7d |\n", $UNRESOLVED_FAIL, scalar(@{$res->{$UNRESOLVED_FAIL}}) if (scalar(@{$res->{$UNRESOLVED_FAIL}})); |
| 641 | printf " | %-40s | %7d |\n", $UNRESOLVED_XPASS, scalar(@{$res->{$UNRESOLVED_XPASS}}) if (scalar(@{$res->{$UNRESOLVED_XPASS}})); |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 642 | printf " | %-40s | %7d |\n", $UNRESOLVED_APPEARS, scalar(@{$res->{$UNRESOLVED_APPEARS}}) if (scalar(@{$res->{$UNRESOLVED_APPEARS}})); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 643 | printf " +------------------------------------------+---------+\n"; |
| 644 | printf " | %-40s | %7d |\n", "TOTAL_REGRESSIONS", $rtotal; |
| 645 | printf " +------------------------------------------+---------+\n"; |
| 646 | printf "\n"; |
| 647 | |
| 648 | if ($long) |
| 649 | { |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 650 | print_tclist($PASS_XPASS, @{$res->{$PASS_XPASS}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 651 | print_tclist($PASS_FAIL, @{$res->{$PASS_FAIL}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 652 | print_tclist($PASS_UNRESOLVED, @{$res->{$PASS_UNRESOLVED}}); |
| 653 | print_tclist($PASSED_NOW_TIMEOUTS, @{$res->{$PASSED_NOW_TIMEOUTS}}); |
| 654 | print_tclist($XPASS_FAIL, @{$res->{$XPASS_FAIL}}); |
| 655 | print_tclist($XPASS_APPEARS, @{$res->{$XPASS_APPEARS}}); |
| 656 | print_tclist($XPASS_UNRESOLVED, @{$res->{$XPASS_UNRESOLVED}}); |
| 657 | print_tclist($FAIL_APPEARS, @{$res->{$FAIL_APPEARS}}); |
| 658 | print_tclist($FAIL_UNRESOLVED, @{$res->{$FAIL_UNRESOLVED}}); |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 659 | print_tclist($XFAIL_FAIL, @{$res->{$XFAIL_FAIL}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 660 | print_tclist($XFAIL_DISAPPEARS, @{$res->{$XFAIL_DISAPPEARS}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 661 | print_tclist($XFAIL_UNRESOLVED, @{$res->{$XFAIL_UNRESOLVED}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 662 | print_tclist($UNSUPPORTED_FAIL, @{$res->{$UNSUPPORTED_FAIL}}); |
| 663 | print_tclist($UNSUPPORTED_XPASS, @{$res->{$UNSUPPORTED_XPASS}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 664 | print_tclist($UNSUPPORTED_UNRESOLVED, @{$res->{$UNSUPPORTED_UNRESOLVED}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 665 | print_tclist($UNTESTED_FAIL, @{$res->{$UNTESTED_FAIL}}); |
| 666 | print_tclist($UNTESTED_XPASS, @{$res->{$UNTESTED_XPASS}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 667 | print_tclist($UNTESTED_UNRESOLVED, @{$res->{$UNTESTED_UNRESOLVED}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 668 | print_tclist($UNRESOLVED_FAIL, @{$res->{$UNRESOLVED_FAIL}}); |
| 669 | print_tclist($UNRESOLVED_XPASS, @{$res->{$UNRESOLVED_XPASS}}); |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 670 | print_tclist($UNRESOLVED_APPEARS, @{$res->{$UNRESOLVED_APPEARS}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 671 | } |
| 672 | printf "$col_reset\n"; |
| 673 | } |
| 674 | |
| 675 | #### MINOR TO BE CHECKED ? |
| 676 | if (not $quiet and not $short) |
| 677 | { |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 678 | $total_better = |
Christophe Lyon | 31279df | 2016-07-04 17:02:12 +0200 | [diff] [blame^] | 679 | scalar(@{$res->{$PASS_DISAPPEARS}})+ |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 680 | scalar(@{$res->{$PASS_XFAIL}})+ |
| 681 | scalar(@{$res->{$PASS_APPEARS}})+ |
| 682 | scalar(@{$res->{$PASS_UNSUPPORTED}})+ |
| 683 | scalar(@{$res->{$PASS_UNTESTED}})+ |
| 684 | scalar(@{$res->{$XPASS_PASS}})+ |
| 685 | scalar(@{$res->{$XPASS_XFAIL}})+ |
| 686 | scalar(@{$res->{$XPASS_UNSUPPORTED}})+ |
| 687 | scalar(@{$res->{$XPASS_UNTESTED}})+ |
| 688 | scalar(@{$res->{$XPASS_DISAPPEARS}})+ |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 689 | scalar(@{$res->{$FAIL_PASS}})+ |
| 690 | scalar(@{$res->{$FAIL_XPASS}})+ |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 691 | scalar(@{$res->{$FAIL_XFAIL}})+ |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 692 | scalar(@{$res->{$FAIL_UNSUPPORTED}})+ |
| 693 | scalar(@{$res->{$FAIL_UNTESTED}})+ |
| 694 | scalar(@{$res->{$FAIL_DISAPPEARS}})+ |
| 695 | scalar(@{$res->{$XFAIL_PASS}})+ |
| 696 | scalar(@{$res->{$XFAIL_XPASS}})+ |
| 697 | scalar(@{$res->{$XFAIL_UNSUPPORTED}})+ |
| 698 | scalar(@{$res->{$XFAIL_UNTESTED}})+ |
| 699 | scalar(@{$res->{$XFAIL_APPEARS}})+ |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 700 | scalar(@{$res->{$UNSUPPORTED_PASS}})+ |
| 701 | scalar(@{$res->{$UNSUPPORTED_XFAIL}})+ |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 702 | scalar(@{$res->{$UNSUPPORTED_UNTESTED}})+ |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 703 | scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}})+ |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 704 | scalar(@{$res->{$UNSUPPORTED_APPEARS}})+ |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 705 | scalar(@{$res->{$UNTESTED_PASS}})+ |
| 706 | scalar(@{$res->{$UNTESTED_XFAIL}})+ |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 707 | scalar(@{$res->{$UNTESTED_UNSUPPORTED}})+ |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 708 | scalar(@{$res->{$UNTESTED_DISAPPEARS}})+ |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 709 | scalar(@{$res->{$UNTESTED_APPEARS}})+ |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 710 | scalar(@{$res->{$UNRESOLVED_PASS}})+ |
| 711 | scalar(@{$res->{$UNRESOLVED_XFAIL}})+ |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 712 | scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}})+ |
| 713 | scalar(@{$res->{$UNRESOLVED_UNTESTED}})+ |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 714 | scalar(@{$res->{$UNRESOLVED_DISAPPEARS}})+ |
Christophe Lyon | f5aeb34 | 2015-12-08 14:47:16 +0100 | [diff] [blame] | 715 | scalar(@{$res->{$UNHANDLED_CASES}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 716 | |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 717 | printf "$col_pink"."o MINOR TO BE CHECKED:\n"; |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 718 | printf " +------------------------------------------+---------+\n"; |
Christophe Lyon | 31279df | 2016-07-04 17:02:12 +0200 | [diff] [blame^] | 719 | printf " | %-40s | %7d |\n", $PASS_DISAPPEARS, scalar(@{$res->{$PASS_DISAPPEARS}}) if (scalar(@{$res->{$PASS_DISAPPEARS}})); |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 720 | printf " | %-40s | %7d |\n", $PASS_XFAIL, scalar(@{$res->{$PASS_XFAIL}}) if (scalar(@{$res->{$PASS_XFAIL}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 721 | printf " | %-40s | %7d |\n", $PASS_APPEARS, scalar(@{$res->{$PASS_APPEARS}}) if (scalar(@{$res->{$PASS_APPEARS}})); |
| 722 | printf " | %-40s | %7d |\n", $PASS_UNSUPPORTED, scalar(@{$res->{$PASS_UNSUPPORTED}}) if (scalar(@{$res->{$PASS_UNSUPPORTED}})); |
| 723 | printf " | %-40s | %7d |\n", $PASS_UNTESTED, scalar(@{$res->{$PASS_UNTESTED}}) if (scalar(@{$res->{$PASS_UNTESTED}})); |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 724 | printf " | %-40s | %7d |\n", $XPASS_PASS, scalar(@{$res->{$XPASS_PASS}}) if (scalar(@{$res->{$XPASS_PASS}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 725 | printf " | %-40s | %7d |\n", $XPASS_XFAIL, scalar(@{$res->{$XPASS_XFAIL}}) if (scalar(@{$res->{$XPASS_XFAIL}})); |
| 726 | printf " | %-40s | %7d |\n", $XPASS_UNSUPPORTED, scalar(@{$res->{$XPASS_UNSUPPORTED}}) if (scalar(@{$res->{$XPASS_UNSUPPORTED}})); |
| 727 | printf " | %-40s | %7d |\n", $XPASS_UNTESTED, scalar(@{$res->{$XPASS_UNTESTED}}) if (scalar(@{$res->{$XPASS_UNTESTED}})); |
| 728 | printf " | %-40s | %7d |\n", $XPASS_DISAPPEARS, scalar(@{$res->{$XPASS_DISAPPEARS}}) if (scalar(@{$res->{$XPASS_DISAPPEARS}})); |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 729 | printf " | %-40s | %7d |\n", $FAIL_PASS, scalar(@{$res->{$FAIL_PASS}}) if (scalar(@{$res->{$FAIL_PASS}})); |
| 730 | printf " | %-40s | %7d |\n", $FAIL_XPASS, scalar(@{$res->{$FAIL_XPASS}}) if (scalar(@{$res->{$FAIL_XPASS}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 731 | printf " | %-40s | %7d |\n", $FAIL_XFAIL, scalar(@{$res->{$FAIL_XFAIL}}) if (scalar(@{$res->{$FAIL_XFAIL}})); |
| 732 | printf " | %-40s | %7d |\n", $FAIL_UNSUPPORTED, scalar(@{$res->{$FAIL_UNSUPPORTED}}) if (scalar(@{$res->{$FAIL_UNSUPPORTED}})); |
| 733 | printf " | %-40s | %7d |\n", $FAIL_UNTESTED, scalar(@{$res->{$FAIL_UNTESTED}}) if (scalar(@{$res->{$FAIL_UNTESTED}})); |
| 734 | printf " | %-40s | %7d |\n", $FAIL_DISAPPEARS, scalar(@{$res->{$FAIL_DISAPPEARS}}) if (scalar(@{$res->{$FAIL_DISAPPEARS}})); |
| 735 | printf " | %-40s | %7d |\n", $XFAIL_PASS, scalar(@{$res->{$XFAIL_PASS}}) if (scalar(@{$res->{$XFAIL_PASS}})); |
| 736 | printf " | %-40s | %7d |\n", $XFAIL_XPASS, scalar(@{$res->{$XFAIL_XPASS}}) if (scalar(@{$res->{$XFAIL_XPASS}})); |
| 737 | printf " | %-40s | %7d |\n", $XFAIL_UNSUPPORTED, scalar(@{$res->{$XFAIL_UNSUPPORTED}}) if (scalar(@{$res->{$XFAIL_UNSUPPORTED}})); |
| 738 | printf " | %-40s | %7d |\n", $XFAIL_UNTESTED, scalar(@{$res->{$XFAIL_UNTESTED}}) if (scalar(@{$res->{$XFAIL_UNTESTED}})); |
| 739 | 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] | 740 | printf " | %-40s | %7d |\n", $UNSUPPORTED_PASS, scalar(@{$res->{$UNSUPPORTED_PASS}}) if (scalar(@{$res->{$UNSUPPORTED_PASS}})); |
| 741 | printf " | %-40s | %7d |\n", $UNSUPPORTED_XFAIL, scalar(@{$res->{$UNSUPPORTED_XFAIL}}) if (scalar(@{$res->{$UNSUPPORTED_XFAIL}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 742 | printf " | %-40s | %7d |\n", $UNSUPPORTED_UNTESTED, scalar(@{$res->{$UNSUPPORTED_UNTESTED}}) if (scalar(@{$res->{$UNSUPPORTED_UNTESTED}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 743 | printf " | %-40s | %7d |\n", $UNSUPPORTED_DISAPPEARS, scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_DISAPPEARS}})); |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 744 | printf " | %-40s | %7d |\n", $UNSUPPORTED_APPEARS, scalar(@{$res->{$UNSUPPORTED_APPEARS}}) if (scalar(@{$res->{$UNSUPPORTED_APPEARS}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 745 | printf " | %-40s | %7d |\n", $UNTESTED_PASS, scalar(@{$res->{$UNTESTED_PASS}}) if (scalar(@{$res->{$UNTESTED_PASS}})); |
| 746 | printf " | %-40s | %7d |\n", $UNTESTED_XFAIL, scalar(@{$res->{$UNTESTED_XFAIL}}) if (scalar(@{$res->{$UNTESTED_XFAIL}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 747 | printf " | %-40s | %7d |\n", $UNTESTED_UNSUPPORTED, scalar(@{$res->{$UNTESTED_UNSUPPORTED}}) if (scalar(@{$res->{$UNTESTED_UNSUPPORTED}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 748 | printf " | %-40s | %7d |\n", $UNTESTED_DISAPPEARS, scalar(@{$res->{$UNTESTED_DISAPPEARS}}) if (scalar(@{$res->{$UNTESTED_DISAPPEARS}})); |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 749 | printf " | %-40s | %7d |\n", $UNTESTED_APPEARS, scalar(@{$res->{$UNTESTED_APPEARS}}) if (scalar(@{$res->{$UNTESTED_APPEARS}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 750 | printf " | %-40s | %7d |\n", $UNRESOLVED_PASS, scalar(@{$res->{$UNRESOLVED_PASS}}) if (scalar(@{$res->{$UNRESOLVED_PASS}})); |
| 751 | printf " | %-40s | %7d |\n", $UNRESOLVED_XFAIL, scalar(@{$res->{$UNRESOLVED_XFAIL}}) if (scalar(@{$res->{$UNRESOLVED_XFAIL}})); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 752 | printf " | %-40s | %7d |\n", $UNRESOLVED_UNSUPPORTED, scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}}) if (scalar(@{$res->{$UNRESOLVED_UNSUPPORTED}})); |
| 753 | printf " | %-40s | %7d |\n", $UNRESOLVED_UNTESTED, scalar(@{$res->{$UNRESOLVED_UNTESTED}}) if (scalar(@{$res->{$UNRESOLVED_UNTESTED}})); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 754 | 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] | 755 | printf " | %-40s | %7d |\n", $UNHANDLED_CASES, scalar(@{$res->{$UNHANDLED_CASES}}) if (scalar(@{$res->{$UNHANDLED_CASES}})); |
| 756 | printf " | %-40s | %7d |\n", $UNSTABLE_CASES, scalar(@{$res->{$UNSTABLE_CASES}}) if (scalar(@{$res->{$UNSTABLE_CASES}})); |
| 757 | printf " +------------------------------------------+---------+\n"; |
Christophe Lyon | f5aeb34 | 2015-12-08 14:47:16 +0100 | [diff] [blame] | 758 | 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] | 759 | printf " +------------------------------------------+---------+\n"; |
| 760 | printf "\n"; |
| 761 | |
| 762 | if ($long) |
| 763 | { |
Christophe Lyon | 31279df | 2016-07-04 17:02:12 +0200 | [diff] [blame^] | 764 | print_tclist($PASS_DISAPPEARS, @{$res->{$PASS_DISAPPEARS}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 765 | print_tclist($PASS_XFAIL, @{$res->{$PASS_XFAIL}}); |
| 766 | print_tclist($PASS_APPEARS, @{$res->{$PASS_APPEARS}}); |
| 767 | print_tclist($PASS_UNSUPPORTED, @{$res->{$PASS_UNSUPPORTED}}); |
| 768 | print_tclist($PASS_UNTESTED, @{$res->{$PASS_UNTESTED}}); |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 769 | print_tclist($XPASS_PASS, @{$res->{$XPASS_PASS}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 770 | print_tclist($XPASS_XFAIL, @{$res->{$XPASS_XFAIL}}); |
| 771 | print_tclist($XPASS_UNSUPPORTED, @{$res->{$XPASS_UNSUPPORTED}}); |
| 772 | print_tclist($XPASS_UNTESTED, @{$res->{$XPASS_UNTESTED}}); |
| 773 | print_tclist($XPASS_DISAPPEARS, @{$res->{$XPASS_DISAPPEARS}}); |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 774 | print_tclist($XFAIL_PASS, @{$res->{$XFAIL_PASS}}); |
| 775 | print_tclist($XFAIL_XPASS, @{$res->{$XFAIL_XPASS}}); |
| 776 | print_tclist($FAIL_PASS, @{$res->{$FAIL_PASS}}); |
| 777 | print_tclist($FAIL_XPASS, @{$res->{$FAIL_XPASS}}); |
Christophe Lyon | dded4d8 | 2016-06-28 18:12:38 +0200 | [diff] [blame] | 778 | print_tclist($FAIL_XFAIL, @{$res->{$FAIL_XFAIL}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 779 | print_tclist($FAIL_UNSUPPORTED, @{$res->{$FAIL_UNSUPPORTED}}); |
| 780 | print_tclist($FAIL_UNTESTED, @{$res->{$FAIL_UNTESTED}}); |
| 781 | print_tclist($FAIL_DISAPPEARS, @{$res->{$FAIL_DISAPPEARS}}); |
| 782 | print_tclist($XFAIL_PASS, @{$res->{$XFAIL_PASS}}); |
| 783 | print_tclist($XFAIL_XPASS, @{$res->{$XFAIL_XPASS}}); |
| 784 | print_tclist($XFAIL_UNSUPPORTED, @{$res->{$XFAIL_UNSUPPORTED}}); |
| 785 | print_tclist($XFAIL_UNTESTED, @{$res->{$XFAIL_UNTESTED}}); |
| 786 | print_tclist($XFAIL_APPEARS, @{$res->{$XFAIL_APPEARS}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 787 | print_tclist($UNSUPPORTED_PASS, @{$res->{$UNSUPPORTED_PASS}}); |
| 788 | print_tclist($UNSUPPORTED_XFAIL, @{$res->{$UNSUPPORTED_XFAIL}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 789 | print_tclist($UNSUPPORTED_UNTESTED, @{$res->{$UNSUPPORTED_UNTESTED}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 790 | print_tclist($UNSUPPORTED_DISAPPEARS, @{$res->{$UNSUPPORTED_DISAPPEARS}}); |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 791 | print_tclist($UNSUPPORTED_APPEARS, @{$res->{$UNSUPPORTED_APPEARS}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 792 | print_tclist($UNTESTED_PASS, @{$res->{$UNTESTED_PASS}}); |
| 793 | print_tclist($UNTESTED_XFAIL, @{$res->{$UNTESTED_XFAIL}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 794 | print_tclist($UNTESTED_UNSUPPORTED, @{$res->{$UNTESTED_UNSUPPORTED}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 795 | print_tclist($UNTESTED_DISAPPEARS, @{$res->{$UNTESTED_DISAPPEARS}}); |
Christophe Lyon | dc66fc5 | 2016-04-05 17:38:07 +0200 | [diff] [blame] | 796 | print_tclist($UNTESTED_APPEARS, @{$res->{$UNTESTED_APPEARS}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 797 | print_tclist($UNRESOLVED_PASS, @{$res->{$UNRESOLVED_PASS}}); |
| 798 | print_tclist($UNRESOLVED_XFAIL, @{$res->{$UNRESOLVED_XFAIL}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 799 | print_tclist($UNRESOLVED_UNSUPPORTED, @{$res->{$UNRESOLVED_UNSUPPORTED}}); |
| 800 | print_tclist($UNRESOLVED_UNTESTED, @{$res->{$UNRESOLVED_UNTESTED}}); |
Christophe Lyon | a140aa8 | 2015-12-17 22:53:03 +0100 | [diff] [blame] | 801 | print_tclist($UNRESOLVED_DISAPPEARS, @{$res->{$UNRESOLVED_DISAPPEARS}}); |
Christophe Lyon | 9dde333 | 2016-06-28 23:00:00 +0200 | [diff] [blame] | 802 | print_tclist($UNHANDLED_CASES, @{$res->{$UNHANDLED_CASES}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 803 | print_tclist($UNSTABLE_CASES, @{$res->{$UNSTABLE_CASES}}); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 804 | } |
| 805 | printf "$col_reset\n"; |
| 806 | } |
| 807 | |
Christophe Lyon | f5aeb34 | 2015-12-08 14:47:16 +0100 | [diff] [blame] | 808 | $return_value = 1 if ($total_better); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 809 | |
| 810 | $return_value = 2 if ($rtotal); |
| 811 | |
Christophe Lyon | d618f66 | 2016-02-02 19:07:58 +0100 | [diff] [blame] | 812 | # Error if there was no PASS (eg when sth went wrong and no .sum was generated) |
| 813 | $return_value = 2 if (($res->{PASS} + $res->{XFAIL}) == 0); |
| 814 | |
| 815 | # Error if every test passed, or the ratio was too low. This |
| 816 | # generally means the simulator is not configured well. |
| 817 | $return_value = 2 if (($ref_ratio == 100) || ($ref_ratio < $ratio_thresh)); |
| 818 | $return_value = 2 if (($res_ratio == 100) || ($res_ratio < $ratio_thresh)); |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 819 | |
Christophe Lyon | ad8c724 | 2016-02-03 13:04:28 +0100 | [diff] [blame] | 820 | # Error if no execution test passed. |
| 821 | # It is possible that no execution test fails, though. |
| 822 | $return_value = 2 if (($ignore_exec == 0) |
| 823 | && (($ref->{EXEC}->{PASS} == 0) |
| 824 | || ($res->{EXEC}->{PASS} == 0))); |
| 825 | |
Christophe Lyon | bff3961 | 2015-11-18 16:29:11 +0100 | [diff] [blame] | 826 | return $return_value; |
| 827 | } |