aboutsummaryrefslogtreecommitdiff
path: root/test/sanitizer_common/ios_commands/iossim_run.py
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-02 18:30:55 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-02 18:30:55 +0000
commit8d8e909cdc9f4e78e1e1600497d827e1acde6cea (patch)
treec8c6047827589e56f2ed1f77f23b1f7d1a10e793 /test/sanitizer_common/ios_commands/iossim_run.py
parent2953104c9a262728031dc518429d15b969dd6028 (diff)
downloadsrc-8d8e909cdc9f4e78e1e1600497d827e1acde6cea.tar.gz
src-8d8e909cdc9f4e78e1e1600497d827e1acde6cea.zip
Vendor import of compiler-rt trunk r301939:vendor/compiler-rt/compiler-rt-trunk-r301939
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=317687 svn path=/vendor/compiler-rt/compiler-rt-trunk-r301939/; revision=317688; tag=vendor/compiler-rt/compiler-rt-trunk-r301939
Diffstat (limited to 'test/sanitizer_common/ios_commands/iossim_run.py')
-rwxr-xr-xtest/sanitizer_common/ios_commands/iossim_run.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/sanitizer_common/ios_commands/iossim_run.py b/test/sanitizer_common/ios_commands/iossim_run.py
new file mode 100755
index 000000000000..732880f35183
--- /dev/null
+++ b/test/sanitizer_common/ios_commands/iossim_run.py
@@ -0,0 +1,17 @@
+#!/usr/bin/python
+
+import os, sys, subprocess
+
+
+if not "SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER" in os.environ:
+ raise EnvironmentError("Specify SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER to select which simulator to use.")
+
+device_id = os.environ["SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER"]
+
+if "ASAN_OPTIONS" in os.environ:
+ os.environ["SIMCTL_CHILD_ASAN_OPTIONS"] = os.environ["ASAN_OPTIONS"]
+
+exitcode = subprocess.call(["xcrun", "simctl", "spawn", device_id] + sys.argv[1:])
+if exitcode > 125:
+ exitcode = 126
+sys.exit(exitcode)