Title: [90285] trunk/Tools
Revision
90285
Author
[email protected]
Date
2011-07-01 15:11:46 -0700 (Fri, 01 Jul 2011)

Log Message

2011-07-01  Eric Seidel  <[email protected]>

        new-run-webkit-tests results does not understand that mac uses test_expectations files
        https://bugs.webkit.org/show_bug.cgi?id=63838

        Reviewed by Adam Barth.

        We've decided to "enable" test_expectations for the Mac port for now.
        It makes the results.html results much more confusing to read, but at least they're
        no longer lying to us.

        * Scripts/webkitpy/layout_tests/layout_package/manager.py:
        * Scripts/webkitpy/layout_tests/port/base.py:
        * Scripts/webkitpy/layout_tests/port/base_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (90284 => 90285)


--- trunk/Tools/ChangeLog	2011-07-01 22:06:07 UTC (rev 90284)
+++ trunk/Tools/ChangeLog	2011-07-01 22:11:46 UTC (rev 90285)
@@ -1,3 +1,18 @@
+2011-07-01  Eric Seidel  <[email protected]>
+
+        new-run-webkit-tests results does not understand that mac uses test_expectations files
+        https://bugs.webkit.org/show_bug.cgi?id=63838
+
+        Reviewed by Adam Barth.
+
+        We've decided to "enable" test_expectations for the Mac port for now.
+        It makes the results.html results much more confusing to read, but at least they're
+        no longer lying to us.
+
+        * Scripts/webkitpy/layout_tests/layout_package/manager.py:
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+
 2011-07-01  Adam Barth  <[email protected]>
 
         Temporarily disable waiting for ReportCrash to see how this code

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py (90284 => 90285)


--- trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py	2011-07-01 22:06:07 UTC (rev 90284)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py	2011-07-01 22:11:46 UTC (rev 90285)
@@ -206,9 +206,7 @@
     results['num_passes'] = num_passes
     results['num_flaky'] = num_flaky
     results['num_regressions'] = num_regressions
-    # FIXME: If non-chromium ports start using an expectations file,
-    # we should make this check more robust.
-    results['uses_expectations_file'] = port_obj.name().find('chromium') != -1
+    results['uses_expectations_file'] = port_obj.uses_test_expectations_file()
     results['layout_tests_dir'] = port_obj.layout_tests_dir()
     results['has_wdiff'] = port_obj.wdiff_available()
     results['has_pretty_patch'] = port_obj.pretty_patch_available()

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


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2011-07-01 22:06:07 UTC (rev 90284)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2011-07-01 22:11:46 UTC (rev 90285)
@@ -711,6 +711,11 @@
         'snowleopard' should precede 'leopard')."""
         raise NotImplementedError
 
+    def uses_test_expectations_file(self):
+        # This is different from checking test_expectations() is None, because
+        # some ports have Skipped files which are returned as part of test_expectations().
+        return self._filesystem.exists(self.path_to_test_expectations_file())
+
     def test_expectations(self):
         """Returns the test expectations for this port.
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py (90284 => 90285)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py	2011-07-01 22:06:07 UTC (rev 90284)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py	2011-07-01 22:11:46 UTC (rev 90285)
@@ -207,8 +207,7 @@
             prefix = "file://"
             path = test_file
 
-        self.assertEqual(port.filename_to_uri(test_file),
-                         abspath_to_uri(test_file))
+        self.assertEqual(port.filename_to_uri(test_file), abspath_to_uri(test_file))
 
     def test_get_option__set(self):
         options, args = optparse.OptionParser().parse_args([])
@@ -234,8 +233,7 @@
 
     def test_additional_platform_directory(self):
         filesystem = MockFileSystem()
-        options, args = optparse.OptionParser().parse_args([])
-        port = base.Port(port_name='foo', filesystem=filesystem, options=options)
+        port = base.Port(port_name='foo', filesystem=filesystem)
         port.baseline_search_path = lambda: ['LayoutTests/platform/foo']
         layout_test_dir = port.layout_tests_dir()
         test_file = filesystem.join(layout_test_dir, 'fast', 'test.html')
@@ -247,7 +245,7 @@
         self.assertEqual(port.baseline_path(), 'LayoutTests/platform/foo')
 
         # Simple additional platform directory
-        options.additional_platform_directory = ['/tmp/local-baselines']
+        port._options.additional_platform_directory = ['/tmp/local-baselines']
         filesystem.files = {
             '/tmp/local-baselines/fast/test-expected.txt': 'foo',
         }
@@ -257,12 +255,21 @@
         self.assertEqual(port.baseline_path(), '/tmp/local-baselines')
 
         # Multiple additional platform directories
-        options.additional_platform_directory = ['/foo', '/tmp/local-baselines']
+        port._options.additional_platform_directory = ['/foo', '/tmp/local-baselines']
         self.assertEqual(
             port.expected_baselines(test_file, '.txt'),
             [('/tmp/local-baselines', 'fast/test-expected.txt')])
         self.assertEqual(port.baseline_path(), '/foo')
 
+    def test_uses_test_expectations_file(self):
+        filesystem = MockFileSystem()
+        port = base.Port(port_name='foo', filesystem=filesystem)
+        port.path_to_test_expectations_file = lambda: '/mock/test_expectations.txt'
+        self.assertFalse(port.uses_test_expectations_file())
+        port._filesystem = MockFileSystem({'/mock/test_expectations.txt': ''})
+        self.assertTrue(port.uses_test_expectations_file())
+
+
 class VirtualTest(unittest.TestCase):
     """Tests that various methods expected to be virtual are."""
     def assertVirtual(self, method, *args, **kwargs):
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to