[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 09:48:27 PST 2019


yln marked 2 inline comments as done.
yln added inline comments.


================
Comment at: compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py:11
+boot_cmd = ['xcrun', 'simctl', 'bootstatus', device_id, '-b']
+subprocess.check_call(boot_cmd)
+
----------------
delcypher wrote:
> Suggested (but optional improvement). If the command fails print an error message that explains the command to run to boot the iOS simulator.
The command will boot the simulator (the `-b` flag ).

This is the error for an invalid device:
```
➤ env SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER="iPhone Y" ../llvm-project/llvm/utils/lit/lit.py  projects/compiler-rt/test/tsan/IOSSimX86_64Config/ -sv
Invalid device: iPhone Y
Traceback (most recent call last):
  File "/Users/yln/work/llvm-upstream/llvm-project/compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py", line 11, in <module>
    subprocess.check_call(boot_cmd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['xcrun', 'simctl', 'bootstatus', 'iPhone Y', '-b']' returned non-zero exit status 164
Command failed:

lit.py: /Users/yln/work/llvm-upstream/llvm-project/llvm/utils/lit/lit/TestingConfig.py:102: fatal: unable to parse config file '/Users/yln/work/llvm-upstream/llvm-project/compiler-rt/test/lit.common.cfg.py', traceback: Traceback (most recent call last):
  File "/Users/yln/work/llvm-upstream/llvm-project/llvm/utils/lit/lit/TestingConfig.py", line 89, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/Users/yln/work/llvm-upstream/llvm-project/compiler-rt/test/lit.common.cfg.py", line 175, in <module>
    raise e
CalledProcessError: Command '['/Users/yln/work/llvm-upstream/llvm-project/compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py', 'iossim', '/Users/yln/work/llvm-upstream/build/./bin/clang']' returned non-zero exit status 1
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71449





More information about the llvm-commits mailing list