OLD | NEW |
1 #!/usr/bin/perl -w | 1 #!/usr/bin/perl -w |
2 | 2 |
3 # Copyright (C) 2005 Apple Computer, Inc. All rights reserved. | 3 # Copyright (C) 2005 Apple Computer, Inc. All rights reserved. |
4 # | 4 # |
5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
6 # modification, are permitted provided that the following conditions | 6 # modification, are permitted provided that the following conditions |
7 # are met: | 7 # are met: |
8 # | 8 # |
9 # 1. Redistributions of source code must retain the above copyright | 9 # 1. Redistributions of source code must retain the above copyright |
10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
11 # 2. Redistributions in binary form must reproduce the above copyright | 11 # 2. Redistributions in binary form must reproduce the above copyright |
12 # notice, this list of conditions and the following disclaimer in the | 12 # notice, this list of conditions and the following disclaimer in the |
13 # documentation and/or other materials provided with the distribution. | 13 # documentation and/or other materials provided with the distribution. |
14 # 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of | 14 # 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of |
15 # its contributors may be used to endorse or promote products derived | 15 # its contributors may be used to endorse or promote products derived |
16 # from this software without specific prior written permission. | 16 # from this software without specific prior written permission. |
17 # | 17 # |
18 # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 18 # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
19 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 19 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
21 # DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 21 # DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
22 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 22 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
23 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 23 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
24 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
25 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 my $disabledCount = (scalar @disabled); | 87 my $disabledCount = (scalar @disabled); |
88 my $failureCount = (scalar @failures); | 88 my $failureCount = (scalar @failures); |
89 | 89 |
90 $count += $disabledCount; | 90 $count += $disabledCount; |
91 | 91 |
92 my $successCount = $count - $failureCount - $disabledCount; | 92 my $successCount = $count - $failureCount - $disabledCount; |
93 my $percentage = (sprintf "%.1f", ($successCount * 100.0 / $count)); | 93 my $percentage = (sprintf "%.1f", ($successCount * 100.0 / $count)); |
94 | 94 |
95 if ($percentage == 100) { | 95 if ($percentage == 100) { |
96 print "${name}: all ${count} tests succeeded"; | 96 print "${name}: all ${count} tests succeeded"; |
97 } else { | 97 } else { |
98 print "${name}: ${successCount} out of ${count} tests succeeded (${perce
ntage}%)"; | 98 print "${name}: ${successCount} out of ${count} tests succeeded (${perce
ntage}%)"; |
99 } | 99 } |
100 print " ($disabledCount disabled)" if $disabledCount; | 100 print " ($disabledCount disabled)" if $disabledCount; |
101 print "\n"; | 101 print "\n"; |
102 if ($verbose) { | 102 if ($verbose) { |
103 print "\n"; | 103 print "\n"; |
104 if (@disabled) { | 104 if (@disabled) { |
105 print " Disabled:\n"; | 105 print " Disabled:\n"; |
106 | 106 |
107 foreach my $failure (sort @disabled) { | 107 foreach my $failure (sort @disabled) { |
108 $failure =~ s|.*/||; | 108 $failure =~ s|.*/||; |
109 $failure =~ s|-disabled||; | 109 $failure =~ s|-disabled||; |
110 print " ${directory}/${failure}"; | 110 print " ${directory}/${failure}"; |
111 } | 111 } |
112 } | 112 } |
113 if (@failures) { | 113 if (@failures) { |
114 print " Failed:\n"; | 114 print " Failed:\n"; |
115 | 115 |
116 foreach my $failure (sort @failures) { | 116 foreach my $failure (sort @failures) { |
117 $directory =~ m|^dom/(\w+)|; | 117 $directory =~ m|^dom/(\w+)|; |
118 my $extension = $1; | 118 my $extension = $1; |
119 $failure =~ s|.*/||; | 119 $failure =~ s|.*/||; |
120 $failure =~ s|-expected\.txt|.${extension}|; | 120 $failure =~ s|-expected\.txt|.${extension}|; |
121 print " ${directory}/${failure}"; | 121 print " ${directory}/${failure}"; |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 print "\n"; | 125 print "\n"; |
126 } | 126 } |
127 | 127 |
128 $totalCount += $count; | 128 $totalCount += $count; |
129 $totalSuccesses += $successCount; | 129 $totalSuccesses += $successCount; |
130 $totalDisabled += $disabledCount; | 130 $totalDisabled += $disabledCount; |
131 $totalFailed += $failureCount; | 131 $totalFailed += $failureCount; |
132 } | 132 } |
133 | 133 |
134 | 134 |
135 my $totalPercentage = (sprintf "%.1f", ($totalSuccesses * 100.0 / $totalCount)); | 135 my $totalPercentage = (sprintf "%.1f", ($totalSuccesses * 100.0 / $totalCount)); |
136 my $totalDisabledPercentage = (sprintf "%.1f", ($totalDisabled * 100.0 / $totalC
ount)); | 136 my $totalDisabledPercentage = (sprintf "%.1f", ($totalDisabled * 100.0 / $totalC
ount)); |
137 my $totalFailedPercentage = (sprintf "%.1f", ($totalFailed * 100.0 / $totalCount
)); | 137 my $totalFailedPercentage = (sprintf "%.1f", ($totalFailed * 100.0 / $totalCount
)); |
138 | 138 |
139 print "Total: ${totalSuccesses} out of ${totalCount} tests succeeded (${totalPer
centage}%)\n"; | 139 print "Total: ${totalSuccesses} out of ${totalCount} tests succeeded (${totalPer
centage}%)\n"; |
140 print " ${totalDisabled} tests disabled (${totalDisabledPercentage}%)\n"; | 140 print " ${totalDisabled} tests disabled (${totalDisabledPercentage}%)\n"; |
141 print " ${totalFailed} tests failed (${totalFailedPercentage}%)\n"; | 141 print " ${totalFailed} tests failed (${totalFailedPercentage}%)\n"; |
OLD | NEW |