[compiler-rt] a54e18d - [compiler-rt] Use --standalone when running tests on the iOS simulator
Julian Lettner via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 20 08:43:18 PDT 2020
Author: Julian Lettner
Date: 2020-04-20T08:42:57-07:00
New Revision: a54e18df0a979409e792db7dc2c003d3318a43db
URL: https://github.com/llvm/llvm-project/commit/a54e18df0a979409e792db7dc2c003d3318a43db
DIFF: https://github.com/llvm/llvm-project/commit/a54e18df0a979409e792db7dc2c003d3318a43db.diff
LOG: [compiler-rt] Use --standalone when running tests on the iOS simulator
We can use `simctl spawn --standalone` to enable running tests without
the need for an already-booted simulator instance. This also side-steps
the problem of not having a good place to shutdown the instance after
we are finished with testing.
rdar://58118442
Reviewed By: delcypher
Differential Revision: https://reviews.llvm.org/D78409
Added:
Modified:
compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py
compiler-rt/test/sanitizer_common/ios_commands/iossim_run.py
Removed:
################################################################################
diff --git a/compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py b/compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py
index 0cfec6b5777b..ad1b92277875 100755
--- a/compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py
+++ b/compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py
@@ -1,18 +1,5 @@
#!/usr/bin/python
import json
-import os
-import subprocess
-
-
-device_id = os.environ.get('SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER')
-if not device_id:
- raise EnvironmentError('Specify SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER to select which simulator to use.')
-
-DEVNULL = open(os.devnull, 'w')
-subprocess.call(['xcrun', 'simctl', 'shutdown', device_id], stderr=DEVNULL)
-subprocess.check_call(['xcrun', 'simctl', 'boot', device_id])
-# TODO(rdar58118442): we start the simulator here, but we never tear it down
-
print(json.dumps({"env": {}}))
diff --git a/compiler-rt/test/sanitizer_common/ios_commands/iossim_run.py b/compiler-rt/test/sanitizer_common/ios_commands/iossim_run.py
index ec1ed3c7fe49..8af3eec441f2 100755
--- a/compiler-rt/test/sanitizer_common/ios_commands/iossim_run.py
+++ b/compiler-rt/test/sanitizer_common/ios_commands/iossim_run.py
@@ -29,7 +29,7 @@
# We use `shell=True` so that any wildcard globs get expanded by the shell.
exitcode = subprocess.call(rm_cmd_line_str, shell=True)
else:
- exitcode = subprocess.call(["xcrun", "simctl", "spawn", device_id] + sys.argv[1:])
+ exitcode = subprocess.call(["xcrun", "simctl", "spawn", "--standalone", device_id] + sys.argv[1:])
if exitcode > 125:
exitcode = 126
sys.exit(exitcode)
More information about the llvm-commits
mailing list