Commit 0f8c1cf3 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Fix for Xcode 10 swarming-cron deployment.

Conditionally set IDEBundleInjection and libXCTestBundleInject.dylib based
on Xcode version.

Bug: 843236
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I2a13fd1e93cbe87e80b045c1d3010f518a6ed862
Reviewed-on: https://chromium-review.googlesource.com/1141276Reviewed-by: default avatarSergey Berezin <sergeyberezin@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576125}
parent 56a12e68
......@@ -970,6 +970,12 @@ class DeviceTestRunner(TestRunner):
if len(self.udid.splitlines()) != 1:
raise DeviceDetectionError(self.udid)
if xctest:
xcode_info = get_current_xcode_info()
xcode_version = float(xcode_info['version'])
inject_path = 'usr/lib/libXCTestBundleInject.dylib'
# This can be removed once xcode versions < 10 are deprecated.
if 10 > xcode_version:
inject_path = 'Library/PrivateFrameworks/IDEBundleInjection.framework/'
self.xctestrun_file = tempfile.mkstemp()[1]
self.xctestrun_data = {
'TestTargetName': {
......@@ -978,8 +984,7 @@ class DeviceTestRunner(TestRunner):
'TestHostPath': '%s' % self.app_path,
'TestingEnvironmentVariables': {
'DYLD_INSERT_LIBRARIES':
'__PLATFORMS__/iPhoneOS.platform/Developer/Library/'
'PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection',
'__PLATFORMS__/iPhoneOS.platform/Developer/%s' % inject_path,
'DYLD_LIBRARY_PATH':
'__PLATFORMS__/iPhoneOS.platform/Developer/Library',
'DYLD_FRAMEWORK_PATH':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment