summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/lsan/lit_tests/lit.common.cfg
diff options
context:
space:
mode:
authorSergey Matveev <earthdok@google.com>2013-05-31 13:13:55 +0000
committerSergey Matveev <earthdok@google.com>2013-05-31 13:13:55 +0000
commit5494e0bec303af3557f96fa3e6dff88428b885a8 (patch)
treeb94c17606c512e7b986e6a461bb657b442424c4e /compiler-rt/lib/lsan/lit_tests/lit.common.cfg
parent4717d2d4945ced853b80600e3b0c3490e966da34 (diff)
downloadbcm5719-llvm-5494e0bec303af3557f96fa3e6dff88428b885a8.tar.gz
bcm5719-llvm-5494e0bec303af3557f96fa3e6dff88428b885a8.zip
[lsan] Run the leak detection tests under both ASan and LSan.
Change the LSan lit test logic. Now "check-lsan" tests the leak checking functionality in both standalone LSan and ASan. llvm-svn: 183000
Diffstat (limited to 'compiler-rt/lib/lsan/lit_tests/lit.common.cfg')
-rw-r--r--compiler-rt/lib/lsan/lit_tests/lit.common.cfg41
1 files changed, 41 insertions, 0 deletions
diff --git a/compiler-rt/lib/lsan/lit_tests/lit.common.cfg b/compiler-rt/lib/lsan/lit_tests/lit.common.cfg
new file mode 100644
index 00000000000..b3edc9bb219
--- /dev/null
+++ b/compiler-rt/lib/lsan/lit_tests/lit.common.cfg
@@ -0,0 +1,41 @@
+# -*- Python -*-
+
+# Common configuration for running leak detection tests under LSan/ASan.
+
+import os
+
+def get_required_attr(config, attr_name):
+ attr_value = getattr(config, attr_name, None)
+ if not attr_value:
+ lit.fatal("No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
+ return attr_value
+
+# Setup source root.
+lsan_lit_src_root = get_required_attr(config, 'lsan_lit_src_root')
+config.test_source_root = os.path.join(lsan_lit_src_root, 'TestCases')
+
+# Setup attributes common for all compiler-rt projects.
+compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
+compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib", "lit.common.cfg")
+if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
+ lit.fatal("Can't find common compiler-rt lit config at: %r"
+ % compiler_rt_lit_cfg)
+lit.load_config(config, compiler_rt_lit_cfg)
+
+clang_cxxflags = ("-ccc-cxx "
+ + "-g "
+ + "-O0 "
+ + "-m64 ")
+
+config.clang_cxxflags = clang_cxxflags
+
+config.substitutions.append( ("%clangxx ", (" " + config.clang + " " +
+ clang_cxxflags + " ")) )
+
+# LeakSanitizer tests are currently supported on x86-64 Linux only.
+if config.host_os not in ['Linux'] or config.host_arch not in ['x86_64']:
+ config.unsupported = True
+
+config.suffixes = ['.c', '.cc', '.cpp']
OpenPOWER on IntegriCloud