[compiler-rt] r341300 - Give a better error message when trying to run the iossim tests and `SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER` is not set in the environment.

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 3 01:40:19 PDT 2018


Author: delcypher
Date: Mon Sep  3 01:40:19 2018
New Revision: 341300

URL: http://llvm.org/viewvc/llvm-project?rev=341300&view=rev
Log:
Give a better error message when trying to run the iossim tests and `SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER` is not set in the environment.

Summary: Give a better error message when trying to run the iossim tests and `SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER` is not set in the environment.

Reviewers: kubamracek, george.karpenkov

Subscribers: #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D51272

Modified:
    compiler-rt/trunk/test/lit.common.cfg

Modified: compiler-rt/trunk/test/lit.common.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=341300&r1=341299&r2=341300&view=diff
==============================================================================
--- compiler-rt/trunk/test/lit.common.cfg (original)
+++ compiler-rt/trunk/test/lit.common.cfg Mon Sep  3 01:40:19 2018
@@ -127,14 +127,18 @@ elif config.host_os == 'Darwin' and conf
   ios_or_iossim = "iossim" if config.apple_platform.endswith("sim") else "ios"
 
   config.available_features.add('ios')
+  device_id_env = "SANITIZER_" + ios_or_iossim.upper() + "_TEST_DEVICE_IDENTIFIER"
   if ios_or_iossim == "iossim":
     config.available_features.add('iossim')
+    if device_id_env not in os.environ:
+      lit_config.fatal(
+        '{} must be set in the environment when running iossim tests'.format(
+          device_id_env))
   if config.apple_platform != "ios" and config.apple_platform != "iossim":
     config.available_features.add(config.apple_platform)
 
   ios_commands_dir = os.path.join(config.compiler_rt_src_root, "test", "sanitizer_common", "ios_commands")
 
-  device_id_env = "SANITIZER_" + ios_or_iossim.upper() + "_TEST_DEVICE_IDENTIFIER"
   run_wrapper = os.path.join(ios_commands_dir, ios_or_iossim + "_run.py")
   env_wrapper = os.path.join(ios_commands_dir, ios_or_iossim + "_env.py")
   compile_wrapper = os.path.join(ios_commands_dir, ios_or_iossim + "_compile.py")




More information about the llvm-commits mailing list