[PATCH] D71449: [iOS sim] Ensure simulator device is booted in iossim_prepare.py

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 17:48:06 PST 2019


yln created this revision.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71449

Files:
  compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py


Index: compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py
===================================================================
--- compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py
+++ compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py
@@ -2,4 +2,13 @@
 
 import os, sys, subprocess, json
 
+
+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)
+
+
 print(json.dumps({"env": {}}))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71449.233727.patch
Type: text/x-patch
Size: 672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191213/4ddd8a72/attachment.bin>


More information about the llvm-commits mailing list