summaryrefslogtreecommitdiff
path: root/test/asan/Unit/lit.site.cfg.py.in
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-06-27 20:56:04 +0000
committerReid Kleckner <rnk@google.com>2019-06-27 20:56:04 +0000
commit60eb072a16750ccae175e4c06f9135ba3669cbdd (patch)
treee02b08a7781866e05e6390ff90c9b6c735074ff0 /test/asan/Unit/lit.site.cfg.py.in
parent09f9fd48848d915f14c5146b4e67d37b2be45ead (diff)
downloadcompiler-rt-60eb072a16750ccae175e4c06f9135ba3669cbdd.tar.gz
[compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.*
These lit configuration files are really Python source code. Using the .py file extension helps editors and tools use the correct language mode. LLVM and Clang already use this convention for lit configuration, this change simply applies it to all of compiler-rt. Reviewers: vitalybuka, dberris Differential Revision: https://reviews.llvm.org/D63658 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@364591 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/asan/Unit/lit.site.cfg.py.in')
-rw-r--r--test/asan/Unit/lit.site.cfg.py.in32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/asan/Unit/lit.site.cfg.py.in b/test/asan/Unit/lit.site.cfg.py.in
new file mode 100644
index 000000000..1c59a6bad
--- /dev/null
+++ b/test/asan/Unit/lit.site.cfg.py.in
@@ -0,0 +1,32 @@
+@LIT_SITE_CFG_IN_HEADER@
+
+import os
+
+# Load common config for all compiler-rt unit tests.
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
+
+def push_ld_library_path(config, new_path):
+ new_ld_library_path = os.path.pathsep.join(
+ (new_path, config.environment.get('LD_LIBRARY_PATH', '')))
+ config.environment['LD_LIBRARY_PATH'] = new_ld_library_path
+
+# Setup config name.
+config.name = 'AddressSanitizer-Unit'
+
+# Setup test source and exec root. For unit tests, we define
+# it as build directory with ASan unit tests.
+# FIXME: De-hardcode this path.
+if @ASAN_TEST_DYNAMIC@:
+ test_dir = "dynamic"
+else:
+ test_dir = "default"
+config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
+ "lib", "asan", "tests", test_dir)
+
+config.test_source_root = config.test_exec_root
+
+# Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
+push_ld_library_path(config, config.compiler_rt_libdir)
+
+if config.host_os == 'Darwin':
+ config.parallelism_group = config.darwin_sanitizer_parallelism_group_func