<http://webkit.org/b/56730> new-run-webkit-tests fails on Lion seed
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Apr 2011 00:40:02 +0000 (00:40 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Apr 2011 00:40:02 +0000 (00:40 +0000)
Reviewed by Jon Honeycutt.

Teach new-run-webkit-tests about the concept of an unreleased version of Mac OS X.

* Scripts/webkitpy/layout_tests/port/chromium_mac.py:
* Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py:
* Scripts/webkitpy/layout_tests/port/mac.py:
* Scripts/webkitpy/layout_tests/port/mac_unittest.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82752 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
Tools/Scripts/webkitpy/layout_tests/port/mac.py
Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py

index 232fd29..573f050 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-29  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Jon Honeycutt.
+
+        <http://webkit.org/b/56730> new-run-webkit-tests fails on Lion seed
+
+        Teach new-run-webkit-tests about the concept of an unreleased version of Mac OS X.
+
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+
 2011-04-01  Chang Shu  <cshu@webkit.org>
 
         Reviewed by Csaba Osztrogon√°c.
index b45d8da..7f57bdf 100644 (file)
@@ -43,7 +43,7 @@ _log = logging.getLogger("webkitpy.layout_tests.port.chromium_mac")
 
 class ChromiumMacPort(chromium.ChromiumPort):
     """Chromium Mac implementation of the Port class."""
-    SUPPORTED_OS_VERSIONS = ('leopard', 'snowleopard')
+    SUPPORTED_OS_VERSIONS = ('leopard', 'snowleopard', 'future')
 
     FALLBACK_PATHS = {
         'leopard': [
@@ -60,6 +60,11 @@ class ChromiumMacPort(chromium.ChromiumPort):
             'mac-snowleopard',
             'mac',
         ],
+        'future': [
+            'chromium-mac',
+            'chromium',
+            'mac',
+        ],
     }
 
     def __init__(self, port_name=None, os_version_string=None, **kwargs):
@@ -76,7 +81,7 @@ class ChromiumMacPort(chromium.ChromiumPort):
         self._operating_system = 'mac'
 
     def baseline_path(self):
-        if self.version() == 'snowleopard':
+        if self.version() in ('snowleopard', 'future'):
             # We treat Snow Leopard as the newest version of mac,
             # so it gets the base dir.
             return self._webkit_baseline_path('chromium-mac')
index b1bbac8..4f9c302 100644 (file)
@@ -53,7 +53,7 @@ class ChromiumMacPortTest(port_testcase.PortTestCase):
 
     def test_versions(self):
         port = chromium_mac.ChromiumMacPort()
-        self.assertTrue(port.name() in ('chromium-mac-leopard', 'chromium-mac-snowleopard'))
+        self.assertTrue(port.name() in ('chromium-mac-leopard', 'chromium-mac-snowleopard', 'chromium-mac-future'))
 
         self.assert_name(None, '10.5.3', 'chromium-mac-leopard')
         self.assert_name('chromium-mac', '10.5.3', 'chromium-mac-leopard')
@@ -65,8 +65,16 @@ class ChromiumMacPortTest(port_testcase.PortTestCase):
         self.assert_name('chromium-mac-snowleopard', '10.5.3', 'chromium-mac-snowleopard')
         self.assert_name('chromium-mac-snowleopard', '10.6.3', 'chromium-mac-snowleopard')
 
-        self.assertRaises(KeyError, self.assert_name, None, '10.7.1', 'chromium-mac-leopard')
-        self.assertRaises(AssertionError, self.assert_name, None, '10.4.1', 'chromium-mac-leopard')
+        self.assert_name(None, '10.7', 'chromium-mac-future')
+        self.assert_name(None, '10.7.3', 'chromium-mac-future')
+        self.assert_name(None, '10.8', 'chromium-mac-future')
+        self.assert_name('chromium-mac', '10.7.3', 'chromium-mac-future')
+        self.assert_name('chromium-mac-future', '10.4.3', 'chromium-mac-future')
+        self.assert_name('chromium-mac-future', '10.5.3', 'chromium-mac-future')
+        self.assert_name('chromium-mac-future', '10.6.3', 'chromium-mac-future')
+        self.assert_name('chromium-mac-future', '10.7.3', 'chromium-mac-future')
+
+        self.assertRaises(AssertionError, self.assert_name, None, '10.4.1', 'should-raise-assertion-so-this-value-does-not-matter')
 
     def test_baseline_path(self):
         port = chromium_mac.ChromiumMacPort(port_name='chromium-mac-leopard')
index 8b62595..5b4c9d9 100644 (file)
@@ -39,7 +39,6 @@ _log = logging.getLogger("webkitpy.layout_tests.port.mac")
 
 
 def os_version(os_version_string=None, supported_versions=None):
-    # We only support Tiger, Leopard, and Snow Leopard.
     if not os_version_string:
         if hasattr(platform, 'mac_ver') and platform.mac_ver()[0]:
             os_version_string = platform.mac_ver()[0]
@@ -52,7 +51,8 @@ def os_version(os_version_string=None, supported_versions=None):
         5: 'leopard',
         6: 'snowleopard',
     }
-    version_string = version_strings[release_version]
+    assert release_version >= min(version_strings.keys())
+    version_string = version_strings.get(release_version, 'future')
     if supported_versions:
         assert version_string in supported_versions
     return version_string
@@ -62,12 +62,13 @@ class MacPort(WebKitPort):
     """WebKit Mac implementation of the Port class."""
     # FIXME: 'wk2' probably shouldn't be a version, it should probably be
     # a modifier, like 'chromium-gpu' is to 'chromium'.
-    SUPPORTED_VERSIONS = ('tiger', 'leopard', 'snowleopard', 'wk2')
+    SUPPORTED_VERSIONS = ('tiger', 'leopard', 'snowleopard', 'future', 'wk2')
 
     FALLBACK_PATHS = {
         'tiger': ['mac-tiger', 'mac-leopard', 'mac-snowleopard', 'mac'],
         'leopard': ['mac-leopard', 'mac-snowleopard', 'mac'],
         'snowleopard': ['mac-snowleopard', 'mac'],
+        'future': ['mac'],
         'wk2': ['mac-wk2', 'mac'],
     }
 
@@ -97,6 +98,13 @@ class MacPort(WebKitPort):
             return 'processes'
         return 'threads'
 
+    def baseline_path(self):
+        if self.version() != 'future':
+            return WebKitPort.baseline_path(self)
+
+        assert(self._name[-7:] == '-future')
+        return self._webkit_baseline_path(self._name[:-7])
+
     def baseline_search_path(self):
         return map(self._webkit_baseline_path, self.FALLBACK_PATHS[self._version])
 
index 0ea7439..be012b8 100644 (file)
@@ -91,7 +91,7 @@ svg/batik/text/smallFonts.svg
     def test_versions(self):
         port = self.make_port()
         if port:
-            self.assertTrue(port.name() in ('mac-tiger', 'mac-leopard', 'mac-snowleopard'))
+            self.assertTrue(port.name() in ('mac-tiger', 'mac-leopard', 'mac-snowleopard', 'mac-future'))
 
         self.assert_name(None, '10.4.8', 'mac-tiger')
         self.assert_name('mac', '10.4.8', 'mac-tiger')
@@ -111,8 +111,16 @@ svg/batik/text/smallFonts.svg
         self.assert_name('mac-snowleopard', '10.5.3', 'mac-snowleopard')
         self.assert_name('mac-snowleopard', '10.6.3', 'mac-snowleopard')
 
-        self.assertRaises(KeyError, self.assert_name, None, '10.7.1', 'mac-leopard')
-        self.assertRaises(KeyError, self.assert_name, None, '10.3.1', 'mac-leopard')
+        self.assert_name(None, '10.7', 'mac-future')
+        self.assert_name(None, '10.7.3', 'mac-future')
+        self.assert_name(None, '10.8', 'mac-future')
+        self.assert_name('mac', '10.7.3', 'mac-future')
+        self.assert_name('mac-future', '10.4.3', 'mac-future')
+        self.assert_name('mac-future', '10.5.3', 'mac-future')
+        self.assert_name('mac-future', '10.6.3', 'mac-future')
+        self.assert_name('mac-future', '10.7.3', 'mac-future')
+
+        self.assertRaises(AssertionError, self.assert_name, None, '10.3.1', 'should-raise-assertion-so-this-value-does-not-matter')
 
 
 if __name__ == '__main__':