summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
diff options
context:
space:
mode:
authorJulian Lettner <julian.lettner@apple.com>2019-12-16 09:33:11 -0800
committerJulian Lettner <julian.lettner@apple.com>2019-12-20 13:44:01 -0800
commitd1783db9dbda78d04cd131a93978edf8f497e58b (patch)
treea5d03b89c365a4277f5c1c9025edb22beacf2f76 /compiler-rt/test
parent0378f3a90341d990236c44f297b923a32b35fab1 (diff)
downloadbcm5719-llvm-d1783db9dbda78d04cd131a93978edf8f497e58b.tar.gz
bcm5719-llvm-d1783db9dbda78d04cd131a93978edf8f497e58b.zip
[iOS sim] Ensure simulator device is booted in iossim_prepare.py
Recent versions of the iOS simulator require that a "simulator device" is booted before we can use `simctl spawn` (see iossim_run.py) to start processes. We can use `simctl bootstatus` to ensure that the simulator device is booted before we run any tests via lit. The `-b` option starts the device if necessary. Reviewed By: delcypher Differential Revision: https://reviews.llvm.org/D71449
Diffstat (limited to 'compiler-rt/test')
-rwxr-xr-xcompiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py14
1 files changed, 13 insertions, 1 deletions
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 4b618fe9de8..1a350006c33 100755
--- a/compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py
+++ b/compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py
@@ -1,5 +1,17 @@
#!/usr/bin/python
-import os, sys, subprocess, json
+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.')
+
+boot_cmd = ['xcrun', 'simctl', 'bootstatus', device_id, '-b']
+subprocess.check_call(boot_cmd)
+# TODO(rdar58118442): we start the simulator here, but we never tear it down
+
print(json.dumps({"env": {}}))
OpenPOWER on IntegriCloud