diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-06-04 04:23:20 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-06-04 04:23:20 +0000 |
commit | 44ef1c52c6187236101a917794e90d1e842a13c0 (patch) | |
tree | 8d8c2837e71cc4544bc7601da3e654eb16c4ea43 /lib/msan/lit_tests/lit.cfg | |
parent | a8f31d1eddc571f3fe05fb0e10eadb1598f1f1d9 (diff) | |
download | compiler-rt-44ef1c52c6187236101a917794e90d1e842a13c0.tar.gz |
Merge r182726:release_33
Improve support for compiler-rt tests in CMake build.
Now compiler-rt tests run correctly if compiler-rt is checked out into
arbitrary directory (not necessarily projects/compiler-rt).
Patch by Greg Fitzgerald!
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_33@183180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/lit_tests/lit.cfg')
-rw-r--r-- | lib/msan/lit_tests/lit.cfg | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/msan/lit_tests/lit.cfg b/lib/msan/lit_tests/lit.cfg index e220c38ff..42381885f 100644 --- a/lib/msan/lit_tests/lit.cfg +++ b/lib/msan/lit_tests/lit.cfg @@ -2,6 +2,14 @@ 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 config name. config.name = 'MemorySanitizer' @@ -30,14 +38,6 @@ if llvm_src_root is None: if not llvm_config: DisplayNoConfigMessage() - # Validate that llvm-config points to the same source tree. - llvm_src_root = lit.util.capture(["llvm-config", "--src-root"]).strip() - msan_test_src_root = os.path.join(llvm_src_root, "projects", "compiler-rt", - "lib", "msan", "lit_tests") - if (os.path.realpath(msan_test_src_root) != - os.path.realpath(config.test_source_root)): - DisplayNoConfigMessage() - # Find out the presumed location of generated site config. llvm_obj_root = lit.util.capture(["llvm-config", "--obj-root"]).strip() msan_site_cfg = os.path.join(llvm_obj_root, "projects", "compiler-rt", @@ -49,8 +49,9 @@ if llvm_src_root is None: raise SystemExit # Setup attributes common for all compiler-rt projects. -compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt", - "lib", "lit.common.cfg") +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) |