[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 14:23:19 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit dc90fe902dfbd26157dba1b9a044b929a6f353a9
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 7 17:32:11 2010 +0000

    Change API tester to ask the executable for the list of all
    tests instead of relying on the directory structure.
    https://bugs.webkit.org/show_bug.cgi?id=47359
    
    Reviewed by Anders Carlsson.
    
    * Scripts/run-test-webkit-api: Added.
    * Scripts/webkitdirs.pm:
    Add additional script to just launch the api tester with the correct settings.
    
    * Scripts/run-api-tests:
    Change to use the new --dump-tests options to build the list of tests and change
    output to reflect a (suite, testcase) tuple for each test. Also adds some color.
    
    * TestWebKitAPI/Test.h:
    (TestWebKitAPI::Test::Register::Register):
    * TestWebKitAPI/Tests/WTF/VectorBasic.cpp:
    (TestWebKitAPI::TEST):
    * TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp:
    (TestWebKitAPI::TEST):
    * TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp:
    (TestWebKitAPI::TEST):
    * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
    (TestWebKitAPI::TEST):
    * TestWebKitAPI/Tests/WebKit2/WKString.cpp:
    (TestWebKitAPI::TEST):
    * TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp:
    (TestWebKitAPI::TEST):
    Give each test a suite name in addition to the test name.
    
    * TestWebKitAPI/TestsController.cpp:
    (TestWebKitAPI::TestsController::dumpTestNames):
    (TestWebKitAPI::TestsController::runTestNamed):
    * TestWebKitAPI/TestsController.h:
    * TestWebKitAPI/mac/main.mm:
    (main):
    Add option to print all registered tests.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69317 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 58e71cd..c9cc356 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,43 @@
+2010-10-07  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Change API tester to ask the executable for the list of all
+        tests instead of relying on the directory structure.
+        https://bugs.webkit.org/show_bug.cgi?id=47359
+
+        * Scripts/run-test-webkit-api: Added.
+        * Scripts/webkitdirs.pm:
+        Add additional script to just launch the api tester with the correct settings.
+
+        * Scripts/run-api-tests:
+        Change to use the new --dump-tests options to build the list of tests and change
+        output to reflect a (suite, testcase) tuple for each test. Also adds some color.
+
+        * TestWebKitAPI/Test.h:
+        (TestWebKitAPI::Test::Register::Register):
+        * TestWebKitAPI/Tests/WTF/VectorBasic.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2/WKString.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp:
+        (TestWebKitAPI::TEST):
+        Give each test a suite name in addition to the test name.
+
+        * TestWebKitAPI/TestsController.cpp:
+        (TestWebKitAPI::TestsController::dumpTestNames):
+        (TestWebKitAPI::TestsController::runTestNamed):
+        * TestWebKitAPI/TestsController.h:
+        * TestWebKitAPI/mac/main.mm:
+        (main):
+        Add option to print all registered tests.
+
 2010-10-07  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>, Andras Becsi  <abecsi at webkit.org>, Balazs Kelemen  <kbalazs at webkit.org>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj b/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
index f05c351..1a7ccbb 100644
--- a/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
+++ b/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
@@ -256,7 +256,14 @@
 			isa = PBXProject;
 			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MiniBrowser" */;
 			compatibilityVersion = "Xcode 3.1";
+			developmentRegion = English;
 			hasScannedForEncodings = 1;
+			knownRegions = (
+				English,
+				Japanese,
+				French,
+				German,
+			);
 			mainGroup = 29B97314FDCFA39411CA2CEA /* MiniBrowser */;
 			projectDirPath = "";
 			projectRoot = "";
diff --git a/WebKitTools/Scripts/run-api-tests b/WebKitTools/Scripts/run-api-tests
index a045631..c8b0a6b 100755
--- a/WebKitTools/Scripts/run-api-tests
+++ b/WebKitTools/Scripts/run-api-tests
@@ -24,42 +24,43 @@
 # THE POSSIBILITY OF SUCH DAMAGE.
 
 # Features to add:
-#   - Ability to run a single test.
-#   - Ability to run all tests under one directory.
+#   - Command line option to run a single test.
+#   - Command line option to run all tests in a suite.
 
 use strict;
 use warnings;
 
 use File::Basename;
-use File::Find;
-use File::Spec::Functions;
-use File::Spec;
 use FindBin;
 use Getopt::Long qw(:config pass_through);
 use IPC::Open3;
 use lib $FindBin::Bin;
 use webkitdirs;
+use Term::ANSIColor qw(:constants);
 
-sub splitpath($);
-sub numericcmp($$);
-sub pathcmp($$);
-sub findTestsToRun();
-sub runTest($);
+sub dumpAllTests();
+sub runAllTests();
+sub runAllTestsInSuite($);
+sub runTest($$);
+sub populateTests();
 sub buildTestTool();
 
 my $showHelp = 0;
 my $quiet = 0;
+my $dump = 0;
 
 my $programName = basename($0);
 my $usage = <<EOF;
 Usage: $programName [options]
   --help                Show this help message
   -q|--quite            Less verbose output
+  -d|--dump-tests       Dump the names of testcases without running them
 EOF
 
 GetOptions(
     'help' => \$showHelp,
     'quiet|q' => \$quiet,
+    'dump|d' => \$dump,
 );
 
 if ($showHelp) {
@@ -69,114 +70,117 @@ if ($showHelp) {
 
 setConfiguration();
 buildTestTool();
-my @testsToRun = findTestsToRun();
+my %testsToRun = populateTests();
 
-my $anyFailures = 0;
-for my $testPath (@testsToRun) {
-    my $failed = runTest($testPath);
-    if ($failed) {
-        $anyFailures = 1;
-    }
+if ($dump) {
+    dumpAllTests();
+    exit 0;
 }
-exit $anyFailures;
 
+runAllTests();
 
-sub splitpath($)
+sub dumpAllTests()
 {
-    my ($path) = @_;
-
-    my $pathSeparator = "/";
-    my $dirname = dirname($path) . $pathSeparator;
-    $dirname = "" if $dirname eq "." . $pathSeparator;
-
-    return ($dirname, basename($path));
+    print "Dumping test cases\n";
+    print "------------------\n";
+    for my $suite (keys %testsToRun) {
+        print $suite . ":\n";
+        print map { "    " . $_ . "\n" } @{ $testsToRun{$suite} };
+    }
+    print "------------------\n";
 }
 
-sub numericcmp($$)
+sub runAllTests()
 {
-    my ($aa, $bb) = @_;
-
-    my @a = split /(\d+)/, $aa;
-    my @b = split /(\d+)/, $bb;
-
-    # Compare one chunk at a time.
-    # Each chunk is either all numeric digits, or all not numeric digits.
-    while (@a && @b) {
-        my $a = shift @a;
-        my $b = shift @b;
-        
-        # Use numeric comparison if chunks are non-equal numbers.
-        return $a <=> $b if $a =~ /^\d/ && $b =~ /^\d/ && $a != $b;
-
-        # Use string comparison if chunks are any other kind of non-equal string.
-        return $a cmp $b if $a ne $b;
+    my $anyFailures = 0;
+    for my $suite (keys %testsToRun) {
+        my $failed = runAllTestsInSuite($suite);
+        if ($failed) {
+            $anyFailures = 1;
+        }
     }
-    
-    # One of the two is now empty; compare lengths for result in this case.
-    return @a <=> @b;
+    return $anyFailures;
 }
 
-sub pathcmp($$)
+sub runAllTestsInSuite($)
 {
-    my ($patha, $pathb) = @_;
-
-    my ($dira, $namea) = splitpath($patha);
-    my ($dirb, $nameb) = splitpath($pathb);
-
-    return numericcmp($dira, $dirb) if $dira ne $dirb;
-    return numericcmp($namea, $nameb);
+    my ($suite) = @_;
+    print "Suite: $suite\n";
+
+    my $anyFailures = 0;
+    for my $test (@{$testsToRun{$suite}}) {
+        my $failed = runTest($suite, $test);
+        if ($failed) {
+            $anyFailures = 1;
+        }
+    }
+    
+    return $anyFailures;
 }
 
-sub findTestsToRun()
+sub runTest($$)
 {
-    our %ignoredLocalDirectories = map { $_ => 1 } qw(.svn _svn);
-    our %supportedFileExtensions = map { $_ => 1 } qw(cpp);
-    our $testsDirectory = File::Spec->catfile(sourceDir(), qw(WebKitTools TestWebKitAPI Tests));
-    our @testsFound = ();
-
-    sub directoryFilter
-    {
-        return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
-        return @_;
-    }
+    my ($suite, $testName) = @_;
+    my $test = $suite . "/" . $testName;
 
-    sub fileFilter
-    {
-        my $filename = $_;
-        if ($filename =~ /\.([^.]+)$/) {
-            
-            if (exists $supportedFileExtensions{$1}) {
-                my $path = File::Spec->abs2rel(catfile($File::Find::dir, $filename), $testsDirectory);
-                push @testsFound, $path;
-            }
+    print "    Test: $testName -> ";
+
+    my $result = 0;
+    if (isAppleMacWebKit()) {
+        my $productDir = productDir();
+        $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+        $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
+        my $apiTesterPath = "$productDir/TestWebKitAPI";
+        if (architecture()) {
+            $result = system "arch", "-" . architecture(), $apiTesterPath, $test, @ARGV;
+        } else {
+            $result = system $apiTesterPath, $test, @ARGV;
         }
     }
-
-    chdirWebKit();
-
-    find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $testsDirectory);
-    return sort pathcmp @testsFound;
+    
+    if ($result == 0) {
+        print BOLD GREEN, "Passed", RESET, "\n";
+    } else {
+        print BOLD RED, "Failed", RESET, "\n";
+    }
 }
 
-sub runTest($)
-{
-    my ($testPath) = @_;
-
-    my ($dir, $testFile) = splitpath($testPath);
-    my $test = substr($testFile, 0, rindex($testFile, "."));
-
-    print "Running " . $dir . $test . "\n";
 
+sub populateTests()
+{
     if (isAppleMacWebKit()) {
         my $productDir = productDir();
         $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
         $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
         my $apiTesterPath = "$productDir/TestWebKitAPI";
-        if (!isTiger() && architecture()) {
-            return system "arch", "-" . architecture(), $apiTesterPath, $test, @ARGV;
+
+        my ($pid, $childIn, $childOut);
+        if (architecture()) {
+            $pid = open3($childIn, $childOut, ">&STDERR", "arch", "-" . architecture(), $apiTesterPath, "--dump-tests") or die "Failed to build list of tests!";
         } else {
-            return system $apiTesterPath, $test, @ARGV;
+            $pid = open3($childIn, $childOut, ">&STDERR", $apiTesterPath, "--dump-tests") or die "Failed to build list of tests!";
+        }
+        close($childIn);
+        my @tests = <$childOut>;
+        close($childOut);
+
+        waitpid($pid, 0);
+        my $result = $?;
+
+        if ($result) {
+            print STDERR "Failed to build list of tests!\n";
+            exit exitStatus($result);
         }
+
+        chomp(@tests);
+
+        my %keyedTests = ();
+        for my $test (@tests) {
+            my ($suite, $testName) = split(/\//, $test);
+            push @{$keyedTests{$suite}}, $testName;
+        }
+        
+        return %keyedTests;
     }
 }
 
@@ -184,7 +188,7 @@ sub buildTestTool()
 {
     chdirWebKit();
 
-    my $buildTestTool =  "build-api-tests";
+    my $buildTestTool = "build-api-tests";
     print STDERR "Running $buildTestTool\n";
 
     local *DEVNULL;
diff --git a/WebKitTools/Scripts/run-test-webkit-api b/WebKitTools/Scripts/run-test-webkit-api
new file mode 100755
index 0000000..dfd85d5
--- /dev/null
+++ b/WebKitTools/Scripts/run-test-webkit-api
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 2010 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer. 
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution. 
+# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+#     its contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission. 
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Simplified "run" script for launching the WebKit2 estWebKitAPI.
+
+use strict;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+setConfiguration();
+
+exit exitStatus(runTestWebKitAPI());
diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm
index 2dfdae2..48dadcb 100644
--- a/WebKitTools/Scripts/webkitdirs.pm
+++ b/WebKitTools/Scripts/webkitdirs.pm
@@ -1834,4 +1834,22 @@ sub debugWebKitTestRunner
     return 1;
 }
 
+sub runTestWebKitAPI
+{
+    if (isAppleMacWebKit()) {
+        my $productDir = productDir();
+        print "Starting TestWebKitAPI with DYLD_FRAMEWORK_PATH set to point to $productDir.\n";
+        $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+        $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
+        my $testWebKitAPIPath = "$productDir/TestWebKitAPI";
+        if (!isTiger() && architecture()) {
+            return system "arch", "-" . architecture(), $testWebKitAPIPath, @ARGV;
+        } else {
+            return system $testWebKitAPIPath, @ARGV;
+        }
+    }
+
+    return 1;
+}
+
 1;
diff --git a/WebKitTools/TestWebKitAPI/Test.h b/WebKitTools/TestWebKitAPI/Test.h
index 6a76b9c..93bfd8b 100644
--- a/WebKitTools/TestWebKitAPI/Test.h
+++ b/WebKitTools/TestWebKitAPI/Test.h
@@ -40,9 +40,9 @@ public:
     
     template<typename TestClassTy> class Register {
     public:
-        Register(const std::string& identifier)
+        Register(const std::string& testSuite, const std::string& testCase)
         {
-            TestsController::shared().registerCreateTestFunction(identifier, Register::create);
+            TestsController::shared().registerCreateTestFunction(testSuite + "/" + testCase, Register::create);
         }
     
     private:
@@ -61,23 +61,23 @@ protected:
     std::string m_identifier;
 };
 
-#define TEST_CLASS_NAME(testCaseName) testCaseName##_Test
-#define TEST_REGISTRAR_NAME(testCaseName) testCaseName##_Registrar
+#define TEST_CLASS_NAME(testSuite, testCaseName) testSuite##testCaseName##_Test
+#define TEST_REGISTRAR_NAME(testSuite, testCaseName) testSuite##testCaseName##_Registrar
 
 // Use this to define a new test.
-#define TEST(testCaseName) \
-    class TEST_CLASS_NAME(testCaseName) : public Test { \
+#define TEST(testSuite, testCaseName) \
+    class TEST_CLASS_NAME(testSuite, testCaseName) : public Test { \
     public: \
-        TEST_CLASS_NAME(testCaseName)(const std::string& identifier) \
+        TEST_CLASS_NAME(testSuite, testCaseName)(const std::string& identifier) \
             : Test(identifier) \
         { \
         } \
         virtual void run(); \
     }; \
     \
-    static Test::Register<TEST_CLASS_NAME(testCaseName)> TEST_REGISTRAR_NAME(testCaseName)(#testCaseName); \
+    static Test::Register<TEST_CLASS_NAME(testSuite, testCaseName)> TEST_REGISTRAR_NAME(testSuite, testCaseName)(#testSuite, #testCaseName); \
     \
-    void TEST_CLASS_NAME(testCaseName)::run()
+    void TEST_CLASS_NAME(testSuite, testCaseName)::run()
 
 #define TEST_ASSERT(expression) do { if (!(expression)) { TestsController::shared().testFailed(__FILE__, __LINE__, #expression); return; } } while (0)
 
diff --git a/WebKitTools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp b/WebKitTools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp
index dedd1ff..aa4fa27 100644
--- a/WebKitTools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp
+++ b/WebKitTools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp
@@ -29,12 +29,12 @@
 
 namespace TestWebKitAPI {
 
-TEST(VectorBasic)
+TEST(WTF, VectorBasic)
 {
     Vector<int> intVector;
     TEST_ASSERT(intVector.isEmpty());
     TEST_ASSERT(intVector.size() == 0);
-    TEST_ASSERT(intVector.capacity() == 0);
+    TEST_ASSERT(intVector.capacity() == 1);
 }
 
 } // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp
index cb028d1..a270357 100644
--- a/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp
@@ -54,7 +54,7 @@ static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef us
     testDone = true;
 }
 
-TEST(FrameMIMETypeHTML)
+TEST(WebKit2, FrameMIMETypeHTML)
 {
     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
     WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp
index 35c6e79..3588940 100644
--- a/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp
@@ -54,7 +54,7 @@ static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef us
     testDone = true;
 }
 
-TEST(FrameMIMETypePNG)
+TEST(WebKit2, FrameMIMETypePNG)
 {
     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
     WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
index 420d18f..a0b4058 100644
--- a/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
@@ -97,7 +97,7 @@ static void decidePolicyForMIMEType(WKPageRef page, WKStringRef MIMEType, WKURLR
     WKFramePolicyListenerUse(listener);
 }
 
-TEST(PageLoadBasic)
+TEST(WebKit2, PageLoadBasic)
 {
     State state;
 
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp
index 97962d5..b0b133d 100644
--- a/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp
@@ -29,7 +29,7 @@
 
 namespace TestWebKitAPI {
 
-TEST(WKString)
+TEST(WebKit2, WKString)
 {
     WKStringRef string = WKStringCreateWithUTF8CString("hello");
     TEST_ASSERT(!WKStringIsEmpty(string));
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp
index 3831143..0d6eca3 100644
--- a/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp
@@ -31,7 +31,7 @@
 
 namespace TestWebKitAPI {
 
-TEST(WKStringJSString)
+TEST(WebKit2, WKStringJSString)
 {
     WKStringRef wkString = WKStringCreateWithUTF8CString("hello");
     JSStringRef jsString = JSStringCreateWithUTF8CString("hello");
diff --git a/WebKitTools/TestWebKitAPI/TestsController.cpp b/WebKitTools/TestWebKitAPI/TestsController.cpp
index e6039f4..3499f2c 100644
--- a/WebKitTools/TestWebKitAPI/TestsController.cpp
+++ b/WebKitTools/TestWebKitAPI/TestsController.cpp
@@ -43,6 +43,14 @@ TestsController::TestsController()
 {
 }
 
+void TestsController::dumpTestNames()
+{
+    std::map<std::string, CreateTestFunction>::const_iterator it = m_createTestFunctions.begin();
+    std::map<std::string, CreateTestFunction>::const_iterator end = m_createTestFunctions.end();
+    for (; it != end; ++it)
+        printf("%s\n", (*it).first.c_str());
+}
+
 bool TestsController::runTestNamed(const std::string& identifier)
 {
     CreateTestFunction createTestFunction = m_createTestFunctions[identifier];
@@ -54,9 +62,6 @@ bool TestsController::runTestNamed(const std::string& identifier)
     m_currentTest = createTestFunction(identifier);
     m_currentTest->run();
 
-    if (!m_testFailed)
-        printf("PASS: %s\n", m_currentTest->name().c_str());
-
     delete m_currentTest;
     m_currentTest = 0;
 
diff --git a/WebKitTools/TestWebKitAPI/TestsController.h b/WebKitTools/TestWebKitAPI/TestsController.h
index 19ebfc2..0ff1fc7 100644
--- a/WebKitTools/TestWebKitAPI/TestsController.h
+++ b/WebKitTools/TestWebKitAPI/TestsController.h
@@ -37,6 +37,7 @@ class TestsController {
 public:
     static TestsController& shared();
 
+    void dumpTestNames();
     bool runTestNamed(const std::string&);
 
     // Called by the tests themselves.
diff --git a/WebKitTools/TestWebKitAPI/mac/main.mm b/WebKitTools/TestWebKitAPI/mac/main.mm
index 59dabab..e6dd4a6 100644
--- a/WebKitTools/TestWebKitAPI/mac/main.mm
+++ b/WebKitTools/TestWebKitAPI/mac/main.mm
@@ -31,7 +31,13 @@ int main(int argc, const char* argv[])
 
     [NSApplication sharedApplication];
 
-    bool passed = TestWebKitAPI::TestsController::shared().runTestNamed(std::string(argv[1]));
+    bool passed = true;
+
+    std::string argument(argv[1]);
+    if (argument == "--dump-tests")
+        TestWebKitAPI::TestsController::shared().dumpTestNames();
+    else   
+        passed = TestWebKitAPI::TestsController::shared().runTestNamed(argument);
 
     [pool drain];
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list