3 # Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
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
16 # from this software without specific prior written permission.
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
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
22 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
27 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 # Script to check status of W3C DOM tests that are part of the WebKit tests.
34 use lib $FindBin::Bin;
39 my $verbose = $ARGV[0] && $ARGV[0] eq "-v";
41 my $workingDir = getcwd();
42 my $testDirectory = "$workingDir/LayoutTests";
44 my @suites = ( {"name" => "DOM Level 1 Core (html)", "directory" => "dom/html/level1/core"},
45 {"name" => "DOM Level 2 Core (html)", "directory" => "dom/html/level2/core"},
46 {"name" => "DOM Level 2 Events (html)", "directory" => "dom/html/level2/events"},
47 {"name" => "DOM Level 2 HTML (html)", "directory" => "dom/html/level2/html"},
48 {"name" => "DOM Level 1 Core (xhtml)", "directory" => "dom/xhtml/level1/core"},
49 {"name" => "DOM Level 2 Core (xhtml)", "directory" => "dom/xhtml/level2/core"},
50 {"name" => "DOM Level 2 Events (xhtml)", "directory" => "dom/xhtml/level2/events"},
51 {"name" => "DOM Level 2 HTML (xhtml)", "directory" => "dom/xhtml/level2/html"},
52 {"name" => "DOM Level 3 Core (xhtml)", "directory" => "dom/xhtml/level3/core"});
55 my $totalSuccesses = 0;
56 my $totalDisabled = 0;
59 foreach my $suite (@suites) {
62 my $directory = $suite{"directory"};
63 my $name = $suite{"name"};
64 my @results = `find "${testDirectory}/${directory}" -name "*-expected.txt"`;
65 my @disabled = `find "${testDirectory}/${directory}" -name "*-disabled"`;
70 foreach my $result (@results) {
73 open RESULT, "<$result";
82 push @failures, $result;
86 my $disabledCount = (scalar @disabled);
87 my $failureCount = (scalar @failures);
89 $count += $disabledCount;
91 my $successCount = $count - $failureCount - $disabledCount;
92 my $percentage = (sprintf "%.1f", ($successCount * 100.0 / $count));
94 if ($percentage == 100) {
95 print "${name}: all ${count} tests succeeded";
97 print "${name}: ${successCount} out of ${count} tests succeeded (${percentage}%)";
99 print " ($disabledCount disabled)" if $disabledCount;
104 print " Disabled:\n";
106 foreach my $failure (sort @disabled) {
108 $failure =~ s|-disabled||;
109 print " ${directory}/${failure}";
115 foreach my $failure (sort @failures) {
117 $failure =~ s|-expected\.txt|.html|;
118 print " ${directory}/${failure}";
125 $totalCount += $count;
126 $totalSuccesses += $successCount;
127 $totalDisabled += $disabledCount;
128 $totalFailed += $failureCount;
132 my $totalPercentage = (sprintf "%.1f", ($totalSuccesses * 100.0 / $totalCount));
133 my $totalDisabledPercentage = (sprintf "%.1f", ($totalDisabled * 100.0 / $totalCount));
134 my $totalFailedPercentage = (sprintf "%.1f", ($totalFailed * 100.0 / $totalCount));
136 print "Total: ${totalSuccesses} out of ${totalCount} tests succeeded (${totalPercentage}%)\n";
137 print " ${totalDisabled} tests disabled (${totalDisabledPercentage}%)\n";
138 print " ${totalFailed} tests failed (${totalFailedPercentage}%)\n";