Skip to content

Commit 3fc243a

Browse files
committed
Force lit to execute the ASan and TSan tests on iOS devices
sequentially. The current implementation of commands in `test/sanitizer_common/ios_commands/` for iOS devices cannot be executed in parallel which results in the ASan and TSan tests failing when executed in parallel by lit which was the default behaviour. We now force the ASan and TSan tests to be a new parallelism group named `darwin-ios-device-sanitizer` which allows only one test to be run at a time. We also emit a warning informing the user that tests are being run sequentially. This only applies if the target is an iOS device. Differential Revision: https://reviews.llvm.org/D42156 llvm-svn: 323026
1 parent 0f0a428 commit 3fc243a

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

compiler-rt/test/asan/lit.cfg

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,5 +212,8 @@ else:
212212
if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'SunOS', 'Windows']:
213213
config.unsupported = True
214214

215-
if config.host_os == 'Darwin' and config.target_arch in ["x86_64", "x86_64h"]:
216-
config.parallelism_group = "darwin-64bit-sanitizer"
215+
if config.host_os == 'Darwin':
216+
if config.target_arch in ["x86_64", "x86_64h"]:
217+
config.parallelism_group = "darwin-64bit-sanitizer"
218+
elif config.ios and not config.iossim:
219+
config.parallelism_group = "darwin-ios-device-sanitizer"

compiler-rt/test/lit.common.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,14 @@ if platform.system() == 'Windows':
291291
if platform.system() == 'Darwin':
292292
lit_config.parallelism_groups["darwin-64bit-sanitizer"] = 3
293293

294+
# The current implementation of the tools in sanitizer_common/ios_comamnds
295+
# do not support parallel execution so force sequential execution of the
296+
# tests on iOS devices.
297+
if config.host_os == 'Darwin' and config.ios and not config.iossim:
298+
lit_config.warning("iOS device test cases being run sequentially")
299+
lit_config.parallelism_groups["darwin-ios-device-sanitizer"] = 1
300+
301+
294302
if config.host_os == 'Darwin':
295303
config.substitutions.append( ("%ld_flags_rpath_exe", '-Wl,-rpath,@executable_path/ %dynamiclib') )
296304
config.substitutions.append( ("%ld_flags_rpath_so", '-install_name @rpath/`basename %dynamiclib`') )

compiler-rt/test/tsan/lit.cfg

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,8 @@ if config.host_os not in ['FreeBSD', 'Linux', 'Darwin', 'NetBSD']:
8585
if config.android:
8686
config.unsupported = True
8787

88-
if config.host_os == 'Darwin' and config.target_arch in ["x86_64", "x86_64h"]:
89-
config.parallelism_group = "darwin-64bit-sanitizer"
88+
if config.host_os == 'Darwin':
89+
if config.target_arch in ["x86_64", "x86_64h"]:
90+
config.parallelism_group = "darwin-64bit-sanitizer"
91+
elif config.ios and not config.iossim:
92+
config.parallelism_group = "darwin-ios-device-sanitizer"

0 commit comments

Comments
 (0)