Skip to content

[test] Update get_simulator_command for macOS 11 #37446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
# Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -81,12 +81,16 @@ def darwin_get_watchos_sim_vers():
return [float(v.strip('watchOS')) for v in watchos_version_str]

# Returns the "prefix" command that should be prepended to the command line to
# run an executable compiled for iOS or AppleTV simulator.
def get_simulator_command(run_os, run_cpu, sdk_path):
(name, vers, build) = darwin_get_sdk_version(sdk_path)
# run an executable compiled for an iOS, tvOS, or watchOS simulator.
def get_simulator_command(run_os, run_cpu):
mac_ver_tuple = tuple(int(v) for v in
platform.mac_ver()[0].replace('.', ' ').split())
if run_os == 'ios':
if run_cpu == "i386":
if min(darwin_get_ios_sim_vers()) > 10.3:
if mac_ver_tuple >= (11,):
print("ERROR: The 32-bit iOS simulator is unavailable on macOS 11.0+")
sys.exit(1)
elif min(darwin_get_ios_sim_vers()) > 10.3:
print("ERROR: Your system does not have a 32-bit iOS simulator installed.")
print("INFO: 1. Install iOS 10.3 or older simulator (Xcode -> Preferences -> Components -> Simulators).")
print("INFO: 2. Create a 32-bit iPhone 5 device. Run:")
Expand Down Expand Up @@ -1012,7 +1016,7 @@ if run_vendor == 'apple':
# segmentation faults)
config.target_run = (
"%s %s " %
(xcrun_prefix, get_simulator_command(run_os, run_cpu, config.variant_sdk)))
(xcrun_prefix, get_simulator_command(run_os, run_cpu)))

(sw_vers_name, sw_vers_vers, sw_vers_build) = \
darwin_get_sdk_version(config.variant_sdk)
Expand Down