Skip to content

Commit 8409530

Browse files
committed
Allow simulator tests on Apple Silicon
Some of the conditions in lit.cfg assume a simulator always targets Intel, but this is not true after the introduction of Apple Silicon. Rely instead on `run_environment`. Addresses rdar://108751951
1 parent 3d7df83 commit 8409530

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/lit.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,13 +1157,13 @@ if run_vendor == 'apple':
11571157
target_future_version = ''
11581158

11591159
# Only permit non-executable tests for ARM on Darwin unless you are on macOS
1160-
if 'arm' in run_cpu and run_os not in ('macosx',):
1160+
if 'simulator' not in run_environment and run_os not in ('macosx',):
11611161
if swift_test_mode != 'only_non_executable':
11621162
raise RuntimeError('Device tests are currently only supported when '
11631163
'the swift_test_mode is "only_non_executable". Current '
11641164
'swift_test_mode is {}.'.format(swift_test_mode))
11651165

1166-
if 'arm' in run_cpu and not (run_os == 'macosx' or run_os == 'maccatalyst'):
1166+
if 'simulator' not in run_environment and not (run_os == 'macosx' or run_os == 'maccatalyst'):
11671167
# iOS/tvOS/watchOS device
11681168
if run_os == 'ios':
11691169
lit_config.note('Testing iOS ' + config.variant_triple)
@@ -1202,7 +1202,7 @@ if run_vendor == 'apple':
12021202
(sw_vers_name, sw_vers_vers, sw_vers_build) = \
12031203
darwin_get_sdk_version(config.variant_sdk)
12041204

1205-
elif run_os == 'ios' or run_os == 'tvos' or run_os == 'watchos':
1205+
elif 'simulator' in run_environment:
12061206
# iOS/tvOS/watchOS simulator
12071207
if run_os == 'ios':
12081208
config.available_features.add('DARWIN_SIMULATOR=ios')

0 commit comments

Comments
 (0)