[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
Mon Dec 16 11:12:20 PST 2019


yln updated this revision to Diff 234108.
yln marked an inline comment as done.
yln added a comment.

Add comment about teardown.  Remove unused/organize imports.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71449/new/

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
@@ -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(yln): we start the simulator here, but we never tear it down
+
 
 print(json.dumps({"env": {}}))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71449.234108.patch
Type: text/x-patch
Size: 803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191216/58c5dbb0/attachment.bin>


More information about the llvm-commits mailing list