Skip to content

Commit 7444e62

Browse files
authored
Merge pull request #65766 from edymtt/edymtt/enable-simulator-testing-on-apple-silicon-5.9
[5.9] Allow simulator tests on Apple Silicon
2 parents 1a214ef + 005a040 commit 7444e62

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/lit.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,8 @@ if run_os in ('maccatalyst',):
947947
target_os_abi = 'macosx'
948948
target_os_is_maccatalyst = "TRUE"
949949
config.available_features.add("OS=ios")
950-
# macOS on ASi uses the stable ABI
951-
if run_os in ('macosx',) and run_cpu in ('arm64',):
950+
# macOS and simulators on ASi use the stable ABI
951+
if (run_os in ('macosx',) or 'simulator' in run_environment) and run_cpu in ('arm64',):
952952
target_mandates_stable_abi = "TRUE"
953953
config.available_features.add('swift_only_stable_abi')
954954
if run_os in (
@@ -1186,13 +1186,13 @@ if run_vendor == 'apple':
11861186
target_future_version = ''
11871187

11881188
# Only permit non-executable tests for ARM on Darwin unless you are on macOS
1189-
if 'arm' in run_cpu and run_os not in ('macosx',):
1189+
if 'simulator' not in run_environment and run_os not in ('macosx',):
11901190
if swift_test_mode != 'only_non_executable':
11911191
raise RuntimeError('Device tests are currently only supported when '
11921192
'the swift_test_mode is "only_non_executable". Current '
11931193
'swift_test_mode is {}.'.format(swift_test_mode))
11941194

1195-
if 'arm' in run_cpu and not (run_os == 'macosx' or run_os == 'maccatalyst'):
1195+
if 'simulator' not in run_environment and not (run_os == 'macosx' or run_os == 'maccatalyst'):
11961196
# iOS/tvOS/watchOS device
11971197
if run_os == 'ios':
11981198
lit_config.note('Testing iOS ' + config.variant_triple)
@@ -1231,7 +1231,7 @@ if run_vendor == 'apple':
12311231
(sw_vers_name, sw_vers_vers, sw_vers_build) = \
12321232
darwin_get_sdk_version(config.variant_sdk)
12331233

1234-
elif run_os == 'ios' or run_os == 'tvos' or run_os == 'watchos':
1234+
elif 'simulator' in run_environment:
12351235
# iOS/tvOS/watchOS simulator
12361236
if run_os == 'ios':
12371237
config.available_features.add('DARWIN_SIMULATOR=ios')

0 commit comments

Comments
 (0)