Title: [138314] trunk/Tools
Revision
138314
Author
dpra...@chromium.org
Date
2012-12-20 16:04:40 -0800 (Thu, 20 Dec 2012)

Log Message

TestExpectation fallback is broken
https://bugs.webkit.org/show_bug.cgi?id=105583

Reviewed by Ryosuke Niwa.

When I added support for the -wk2 in port names, it looks
like I broke the way we computed the list of TestExpectations
files so that the implementation-version directory was left out :(.
Fixed and cleaned up the tests.

* Scripts/webkitpy/layout_tests/port/base.py:
(Port.expectations_files):
* Scripts/webkitpy/layout_tests/port/port_testcase.py:
(TestWebKitPort.__init__):
(PortTestCase.test_skipped_directories_for_symbols):
(test_skipped_directories_for_features):
(test_skipped_directories_for_features_no_matching_tests_in_test_list):
(test_skipped_tests_for_unsupported_features_empty_test_list):
(test_skipped_layout_tests):
(test_expectations_files):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (138313 => 138314)


--- trunk/Tools/ChangeLog	2012-12-20 23:57:01 UTC (rev 138313)
+++ trunk/Tools/ChangeLog	2012-12-21 00:04:40 UTC (rev 138314)
@@ -1,3 +1,26 @@
+2012-12-20  Dirk Pranke  <dpra...@chromium.org>
+
+        TestExpectation fallback is broken
+        https://bugs.webkit.org/show_bug.cgi?id=105583
+
+        Reviewed by Ryosuke Niwa.
+
+        When I added support for the -wk2 in port names, it looks
+        like I broke the way we computed the list of TestExpectations
+        files so that the implementation-version directory was left out :(.
+        Fixed and cleaned up the tests.
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        (Port.expectations_files):
+        * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+        (TestWebKitPort.__init__):
+        (PortTestCase.test_skipped_directories_for_symbols):
+        (test_skipped_directories_for_features):
+        (test_skipped_directories_for_features_no_matching_tests_in_test_list):
+        (test_skipped_tests_for_unsupported_features_empty_test_list):
+        (test_skipped_layout_tests):
+        (test_expectations_files):
+
 2012-12-20  Anders Carlsson  <ander...@apple.com>
 
         Don't include WebKit2 headers when building TestWebKitAPI on windows

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (138313 => 138314)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2012-12-20 23:57:01 UTC (rev 138313)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2012-12-21 00:04:40 UTC (rev 138314)
@@ -1071,13 +1071,15 @@
         # Unlike baseline_search_path, we only want to search [WK2-PORT, PORT-VERSION, PORT] and any directories
         # included via --additional-platform-directory, not the full casade.
         search_paths = [self.port_name]
-        if self.name() != self.port_name:
-            search_paths.append(self.name())
 
+        non_wk2_name = self.name().replace('-wk2', '')
+        if non_wk2_name != self.port_name:
+            search_paths.append(non_wk2_name)
+
         if self.get_option('webkit_test_runner'):
             # Because nearly all of the skipped tests for WebKit 2 are due to cross-platform
             # issues, all wk2 ports share a skipped list under platform/wk2.
-            search_paths.extend([self._wk2_port_name(), "wk2"])
+            search_paths.extend(["wk2", self._wk2_port_name()])
 
         search_paths.extend(self.get_option("additional_platform_directory", []))
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py (138313 => 138314)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py	2012-12-20 23:57:01 UTC (rev 138313)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py	2012-12-21 00:04:40 UTC (rev 138314)
@@ -50,12 +50,13 @@
 class TestWebKitPort(Port):
     port_name = "testwebkitport"
 
-    def __init__(self, symbols_string=None,
+    def __init__(self, port_name=None, symbols_string=None,
                  expectations_file=None, skips_file=None, host=None, config=None,
                  **kwargs):
+        port_name = port_name or TestWebKitPort.port_name
         self.symbols_string = symbols_string  # Passing "" disables all staticly-detectable features.
         host = host or MockSystemHost()
-        super(TestWebKitPort, self).__init__(host, TestWebKitPort.port_name, **kwargs)
+        super(TestWebKitPort, self).__init__(host, port_name=port_name, **kwargs)
 
     def all_test_configurations(self):
         return [self.test_configuration()]
@@ -462,7 +463,7 @@
             "inspector/styles/variables",  # Requires CSS Variables
         ])
 
-        result_directories = set(TestWebKitPort(symbols_string, None)._skipped_tests_for_unsupported_features(test_list=['mathml/foo.html']))
+        result_directories = set(TestWebKitPort(symbols_string=symbols_string)._skipped_tests_for_unsupported_features(test_list=['mathml/foo.html']))
         self.assertEqual(result_directories, expected_directories)
 
         # Test that the nm string parsing actually works:
@@ -473,13 +474,13 @@
 """
         # Note 'compositing' is not in the list of skipped directories (hence the parsing of GraphicsLayer worked):
         expected_directories = set(['mathml', 'transforms/3d', 'compositing/webgl', 'fast/canvas/webgl', 'animations/3d', 'mhtml', 'http/tests/canvas/webgl', 'fast/css/variables', 'inspector/styles/variables'])
-        result_directories = set(TestWebKitPort(symbols_string, None)._skipped_tests_for_unsupported_features(test_list=['mathml/foo.html']))
+        result_directories = set(TestWebKitPort(symbols_string=symbols_string)._skipped_tests_for_unsupported_features(test_list=['mathml/foo.html']))
         self.assertEqual(result_directories, expected_directories)
 
     def test_skipped_directories_for_features(self):
         supported_features = ["Accelerated Compositing", "Foo Feature"]
         expected_directories = set(["animations/3d", "transforms/3d"])
-        port = TestWebKitPort(None, supported_features)
+        port = TestWebKitPort(supported_features=supported_features)
         port._runtime_feature_list = lambda: supported_features
         result_directories = set(port._skipped_tests_for_unsupported_features(test_list=["animations/3d/foo.html"]))
         self.assertEqual(result_directories, expected_directories)
@@ -487,17 +488,17 @@
     def test_skipped_directories_for_features_no_matching_tests_in_test_list(self):
         supported_features = ["Accelerated Compositing", "Foo Feature"]
         expected_directories = set([])
-        result_directories = set(TestWebKitPort(None, supported_features)._skipped_tests_for_unsupported_features(test_list=['foo.html']))
+        result_directories = set(TestWebKitPort(supported_features=supported_features)._skipped_tests_for_unsupported_features(test_list=['foo.html']))
         self.assertEqual(result_directories, expected_directories)
 
     def test_skipped_tests_for_unsupported_features_empty_test_list(self):
         supported_features = ["Accelerated Compositing", "Foo Feature"]
         expected_directories = set([])
-        result_directories = set(TestWebKitPort(None, supported_features)._skipped_tests_for_unsupported_features(test_list=None))
+        result_directories = set(TestWebKitPort(supported_features=supported_features)._skipped_tests_for_unsupported_features(test_list=None))
         self.assertEqual(result_directories, expected_directories)
 
     def test_skipped_layout_tests(self):
-        self.assertEqual(TestWebKitPort(None, None).skipped_layout_tests(test_list=[]), set(['media']))
+        self.assertEqual(TestWebKitPort().skipped_layout_tests(test_list=[]), set(['media']))
 
     def test_expectations_files(self):
         port = TestWebKitPort()
@@ -507,13 +508,14 @@
 
         self.assertEqual(platform_dirs(port), ['testwebkitport'])
 
-        port._name = "testwebkitport-version"
+        port = TestWebKitPort(port_name="testwebkitport-version")
         self.assertEqual(platform_dirs(port), ['testwebkitport', 'testwebkitport-version'])
 
-        port._options = MockOptions(webkit_test_runner=True)
-        self.assertEqual(platform_dirs(port), ['testwebkitport', 'testwebkitport-version', 'testwebkitport-wk2', 'wk2'])
+        port = TestWebKitPort(port_name="testwebkitport-version-wk2")
+        self.assertEqual(platform_dirs(port), ['testwebkitport', 'testwebkitport-version', 'wk2', 'testwebkitport-wk2'])
 
-        port._options = MockOptions(additional_platform_directory=["internal-testwebkitport"])
+        port = TestWebKitPort(port_name="testwebkitport-version",
+                              options=MockOptions(additional_platform_directory=["internal-testwebkitport"]))
         self.assertEqual(platform_dirs(port), ['testwebkitport', 'testwebkitport-version', 'internal-testwebkitport'])
 
     def test_root_option(self):
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to