summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2017-04-26 20:38:24 +0000
committerKuba Mracek <mracek@apple.com>2017-04-26 20:38:24 +0000
commit74233bed59a47cd9cf52adb0a22c4dcee38dc5fb (patch)
tree78ad80f9f2f0c36c932ec272132480e0fef4a6ff
parent5652d5eb097490ee96c79a9e0b952736c8e49f91 (diff)
downloadbcm5719-llvm-74233bed59a47cd9cf52adb0a22c4dcee38dc5fb.tar.gz
bcm5719-llvm-74233bed59a47cd9cf52adb0a22c4dcee38dc5fb.zip
[asan] Allow propagating env variables when testing on iOS Simulator
This patch adds "%env" as a way to express that the environment variable should be set on the target device/simulator. This fixes some test failures when testing on iOS/Simulator. Differential Revision: https://reviews.llvm.org/D32556 llvm-svn: 301462
-rw-r--r--compiler-rt/test/asan/TestCases/Darwin/scribble.cc2
-rw-r--r--compiler-rt/test/lit.common.cfg4
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler-rt/test/asan/TestCases/Darwin/scribble.cc b/compiler-rt/test/asan/TestCases/Darwin/scribble.cc
index 0ddee6b5eef..8303cf316a9 100644
--- a/compiler-rt/test/asan/TestCases/Darwin/scribble.cc
+++ b/compiler-rt/test/asan/TestCases/Darwin/scribble.cc
@@ -1,6 +1,6 @@
// RUN: %clang_asan -O2 %s -o %t
// RUN: %run %t 2>&1 | FileCheck --check-prefix=CHECK-NOSCRIBBLE %s
-// RUN: env MallocScribble=1 MallocPreScribble=1 %run %t 2>&1 | FileCheck --check-prefix=CHECK-SCRIBBLE %s
+// RUN: %env MallocScribble=1 MallocPreScribble=1 %run %t 2>&1 | FileCheck --check-prefix=CHECK-SCRIBBLE %s
// RUN: %env_asan_opts=max_free_fill_size=4096 %run %t 2>&1 | FileCheck --check-prefix=CHECK-SCRIBBLE %s
#include <stdint.h>
diff --git a/compiler-rt/test/lit.common.cfg b/compiler-rt/test/lit.common.cfg
index 2f0dd6351a3..cca41a0a050 100644
--- a/compiler-rt/test/lit.common.cfg
+++ b/compiler-rt/test/lit.common.cfg
@@ -96,14 +96,18 @@ config.substitutions.append(
# Allow tests to be executed on a simulator or remotely.
if config.emulator:
config.substitutions.append( ('%run', config.emulator) )
+ config.substitutions.append( ('%env ', "env ") )
elif config.ios:
device_id_env = "SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER" if config.iossim else "SANITIZER_IOS_TEST_DEVICE_IDENTIFIER"
if device_id_env in os.environ: config.environment[device_id_env] = os.environ[device_id_env]
ios_commands_dir = os.path.join(config.compiler_rt_src_root, "test", "sanitizer_common", "ios_commands")
run_wrapper = os.path.join(ios_commands_dir, "iossim_run.py" if config.iossim else "ios_run.py")
config.substitutions.append(('%run', run_wrapper))
+ env_wrapper = os.path.join(ios_commands_dir, "iossim_env.py" if config.iossim else "ios_env.py")
+ config.substitutions.append(('%env ', env_wrapper + " "))
else:
config.substitutions.append( ('%run', "") )
+ config.substitutions.append( ('%env ', "env ") )
# Define CHECK-%os to check for OS-dependent output.
config.substitutions.append( ('CHECK-%os', ("CHECK-" + config.host_os)))
OpenPOWER on IntegriCloud