Changeset 261722 in webkit


Ignore:
Timestamp:
May 14, 2020 4:38:22 PM (4 years ago)
Author:
Jonathan Bedard
Message:

run-webkit-tests shouldn't need Xcode to run Mac tests
https://bugs.webkit.org/show_bug.cgi?id=211903
<rdar://problem/63205839>

Reviewed by Stephanie Lewis.

  • Scripts/webkitpy/common/system/platforminfo.py:

(PlatformInfo):
(PlatformInfo.xcode_sdk_version): Memoize SDK version retrieval.
(PlatformInfo.xcode_version): Only run xcodebuild if macosx SDK is present.
(PlatformInfo.available_sdks): Ditto.

  • Scripts/webkitpy/common/system/platforminfo_unittest.py:

(TestPlatformInfo.test_available_sdks):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r261713 r261722  
     12020-05-14  Jonathan Bedard  <jbedard@apple.com>
     2
     3        run-webkit-tests shouldn't need Xcode to run Mac tests
     4        https://bugs.webkit.org/show_bug.cgi?id=211903
     5        <rdar://problem/63205839>
     6
     7        Reviewed by Stephanie Lewis.
     8
     9        * Scripts/webkitpy/common/system/platforminfo.py:
     10        (PlatformInfo):
     11        (PlatformInfo.xcode_sdk_version): Memoize SDK version retrieval.
     12        (PlatformInfo.xcode_version): Only run xcodebuild if macosx SDK is present.
     13        (PlatformInfo.available_sdks): Ditto.
     14        * Scripts/webkitpy/common/system/platforminfo_unittest.py:
     15        (TestPlatformInfo.test_available_sdks):
     16
    1172020-05-14  Daniel Bates  <dabates@apple.com>
    218
  • trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py

    r251990 r261722  
    3232import sys
    3333
     34from webkitpy.common.memoized import memoized
    3435from webkitpy.common.version import Version
    3536from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE, VersionNameMap
     
    160161        return None
    161162
     163    @memoized
    162164    def xcode_sdk_version(self, sdk_name):
    163165        if self.is_mac():
     
    174176        return (line for line in output.splitlines())
    175177
     178    @memoized
    176179    def xcode_version(self):
    177         if not self.is_mac():
     180        if not self.xcode_sdk_version('macosx'):
    178181            raise NotImplementedError
    179182        return Version.from_string(self._executive.run_command(['xcodebuild', '-version']).split()[1])
    180183
     184    @memoized
    181185    def available_sdks(self):
    182         if not self.is_mac():
     186        if not self.xcode_sdk_version('macosx'):
    183187            return []
    184188
  • trunk/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py

    r250375 r261722  
    161161
    162162    def test_available_sdks(self):
     163        sdk_version_output = '10.16\n'
     164        info = self.make_info(fake_sys('darwin'), fake_platform('10.14.0'), fake_executive(sdk_version_output))
     165        info.xcode_sdk_version('macosx')
     166
    163167        show_sdks_output = """iOS SDKs:
    164168    iOS 12.0                          -sdk iphoneos12.0
     
    178182    Simulator - watchOS 5.0 Internal    -sdk watchsimulator5.0.type
    179183"""
    180         info = self.make_info(fake_sys('darwin'), fake_platform('10.14.0'), fake_executive(show_sdks_output))
     184        info._executive = fake_executive(show_sdks_output)
    181185        self.assertEqual(info.available_sdks(), [
    182186            'iphoneos',
Note: See TracChangeset for help on using the changeset viewer.