https://bugs.webkit.org/show_bug.cgi?id=141711
Reviewed by Alex Christensen.
Run_webkit_tests.py should only parse the iOS-specific command
line options --runtime and --device-type. Let the port-specific
logic in ios.py validate the parsed options and instantiate
internal data structures.
Currently run_webkit_tests.py parses the iOS-specific command
line options --runtime and --device-type, validates them, and
instantiates internal data structures from the parsed strings.
Instead the validation logic and instantiation of internal
data structures should be handled by the iOS port object.
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(_set_up_derived_options): Remove logic to validate --runtime and --device-type
and instantiate internal data structures for them.
* Scripts/webkitpy/port/driver.py:
(IOSSimulatorDriver.cmd_line): Modified to reference IOSSimulatorPort.simulator_runtime
and IOSSimulatorPort.simulator_device_type for the iOS Simulator runtime and device type,
respectively.
* Scripts/webkitpy/port/ios.py: Sort the list of imports.
(IOSSimulatorPort.simulator_runtime): Added. Instantiates a Runtime
object from --runtime, if specified. Otherwise, instantiates a Runtime
object for the latest installed iphonesimulator SDK version.
(IOSSimulatorPort.simulator_device_type): Added. Instantiates a DeviceType
object from --device-type, if specified. Otherwise, instantiates
a DeviceType object for a iPhone 5 or iPhone 5s when on a 32-bit and 64-bit
machine, respectively.
(IOSSimulatorPort.check_sys_deps): Added. Validate if the chosen iOS simulator
runtime is available to use.
(IOSSimulatorPort.testing_device): Modified to make use of properties simulator_device_type
and simulator_runtime for the iOS Simulator device type and runtime, respectively.
* Scripts/webkitpy/xcode/simulator.py:
(Runtime.from_version_string): Added. Turns around and calls Runtime.from_identifier()
with a runtime identifier for the specified iOS version.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180238
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-02-17 Daniel Bates <dabates@apple.com>
+
+ run_webkit_tests.py should not know about iOS Simulator details
+ https://bugs.webkit.org/show_bug.cgi?id=141711
+
+ Reviewed by Alex Christensen.
+
+ Run_webkit_tests.py should only parse the iOS-specific command
+ line options --runtime and --device-type. Let the port-specific
+ logic in ios.py validate the parsed options and instantiate
+ internal data structures.
+
+ Currently run_webkit_tests.py parses the iOS-specific command
+ line options --runtime and --device-type, validates them, and
+ instantiates internal data structures from the parsed strings.
+ Instead the validation logic and instantiation of internal
+ data structures should be handled by the iOS port object.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ (_set_up_derived_options): Remove logic to validate --runtime and --device-type
+ and instantiate internal data structures for them.
+ * Scripts/webkitpy/port/driver.py:
+ (IOSSimulatorDriver.cmd_line): Modified to reference IOSSimulatorPort.simulator_runtime
+ and IOSSimulatorPort.simulator_device_type for the iOS Simulator runtime and device type,
+ respectively.
+ * Scripts/webkitpy/port/ios.py: Sort the list of imports.
+ (IOSSimulatorPort.simulator_runtime): Added. Instantiates a Runtime
+ object from --runtime, if specified. Otherwise, instantiates a Runtime
+ object for the latest installed iphonesimulator SDK version.
+ (IOSSimulatorPort.simulator_device_type): Added. Instantiates a DeviceType
+ object from --device-type, if specified. Otherwise, instantiates
+ a DeviceType object for a iPhone 5 or iPhone 5s when on a 32-bit and 64-bit
+ machine, respectively.
+ (IOSSimulatorPort.check_sys_deps): Added. Validate if the chosen iOS simulator
+ runtime is available to use.
+ (IOSSimulatorPort.testing_device): Modified to make use of properties simulator_device_type
+ and simulator_runtime for the iOS Simulator device type and runtime, respectively.
+ * Scripts/webkitpy/xcode/simulator.py:
+ (Runtime.from_version_string): Added. Turns around and calls Runtime.from_identifier()
+ with a runtime identifier for the specified iOS version.
+
2015-02-17 Dana Burkart <dburkart@apple.com>
ASan does not like JSC::MachineThreads::tryCopyOtherThreadStack
if options.platform == "gtk" or options.platform == "efl":
options.webkit_test_runner = True
- if options.platform == 'ios-simulator':
- from webkitpy import xcode
- if options.runtime is None:
- options.runtime = xcode.simulator.Simulator().latest_available_runtime
- else:
- options.runtime = xcode.simulator.Runtime.from_identifier(options.runtime)
- if not options.runtime.available:
- raise Exception('The iOS Simulator runtime with identifier "{identifier}" cannot be used because it is unavailable.'.format(identifier=options.runtime.identifier))
- if options.device_type is None:
- iphone5 = xcode.simulator.DeviceType.from_name('iPhone 5')
- iphone5s = xcode.simulator.DeviceType.from_name('iPhone 5s')
- options.device_type = iphone5 if options.architecture == 'x86' else iphone5s
- else:
- options.device_type = xcode.simulator.DeviceType.from_identifier(options.device_type)
-
def run(port, options, args, logging_stream):
logger = logging.getLogger()
dump_tool = cmd[0]
dump_tool_args = cmd[1:]
product_dir = self._port._build_path()
- runtime = self._port.get_option('runtime')
- device_type = self._port.get_option('device_type')
relay_args = [
- '-runtime', runtime.identifier,
- '-deviceType', device_type.identifier,
+ '-runtime', self._port.simulator_runtime.identifier,
+ '-deviceType', self._port.simulator_device_type.identifier,
'-suffix', str(self._worker_number),
'-productDir', product_dir,
'-app', dump_tool,
# 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.
+import itertools
import logging
import os
-import shutil
-import time
import re
-import itertools
+import shutil
import subprocess
+import time
-from webkitpy.layout_tests.models.test_configuration import TestConfiguration
+from webkitpy.common.memoized import memoized
from webkitpy.common.system.crashlogs import CrashLogs
from webkitpy.common.system.executive import ScriptError
-from webkitpy.port.apple import ApplePort
+from webkitpy.layout_tests.models.test_configuration import TestConfiguration
+from webkitpy.port import config as port_config
from webkitpy.port import driver, image_diff
+from webkitpy.port.apple import ApplePort
from webkitpy.port.base import Port
from webkitpy.port.leakdetector import LeakDetector
-from webkitpy.port import config as port_config
-from webkitpy.xcode.simulator import Simulator
+from webkitpy.xcode.simulator import Simulator, Runtime, DeviceType
_log = logging.getLogger(__name__)
return 'DumpRenderTree.app'
@property
+ @memoized
+ def simulator_runtime(self):
+ runtime_identifier = self.get_option('runtime')
+ if runtime_identifier:
+ runtime = Runtime.from_identifier(runtime_identifier)
+ else:
+ runtime = Runtime.from_version_string(self.host.platform.xcode_sdk_version('iphonesimulator'))
+ return runtime
+
+ @property
+ @memoized
+ def simulator_device_type(self):
+ device_type_identifier = self.get_option('device_type')
+ if device_type_identifier:
+ device_type = DeviceType.from_identifier(device_type_identifier)
+ else:
+ if self.architecture() == 'x86_64':
+ device_type = DeviceType.from_name('iPhone 5s')
+ else:
+ device_type = DeviceType.from_name('iPhone 5')
+ return device_type
+
+ @property
def relay_path(self):
mac_config = port_config.Config(self._executive, self._filesystem, 'mac')
return self._filesystem.join(mac_config.build_directory(self.get_option('configuration')), self.relay_name)
def operating_system(self):
return 'ios-simulator'
+ def check_sys_deps(self, needs_http):
+ if not self.simulator_runtime.available:
+ _log.error('The iOS Simulator runtime with identifier "{0}" cannot be used because it is unavailable.'.format(self.simulator_runtime.identifier))
+ return False
+ return super(IOSSimulatorPort, self).check_sys_deps(needs_http)
+
def check_for_leaks(self, process_name, process_pid):
if not self.get_option('leaks'):
return
def testing_device(self):
if self._testing_device is not None:
return self._testing_device
-
- device_type = self.get_option('device_type')
- runtime = self.get_option('runtime')
- self._testing_device = Simulator().lookup_or_create_device(device_type.name + ' WebKit Tester', device_type, runtime)
+ self._testing_device = Simulator().lookup_or_create_device(self.simulator_device_type.name + ' WebKit Tester', self.simulator_device_type, self.simulator_runtime)
return self.testing_device
def look_for_new_crash_logs(self, crashed_processes, start_time):
self.is_internal_runtime = is_internal_runtime
@classmethod
+ def from_version_string(cls, version):
+ return cls.from_identifier('com.apple.CoreSimulator.SimRuntime.iOS-' + version.replace('.', '-'))
+
+ @classmethod
def from_identifier(cls, identifier):
"""
:param identifier: The identifier for the desired CoreSimulator runtime.