summaryrefslogtreecommitdiff
path: root/lib/dfsan
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2013-08-09 22:14:01 +0000
committerDaniel Dunbar <daniel@zuster.org>2013-08-09 22:14:01 +0000
commita1b15b4af39b843ebb8545d295aa872829eb8187 (patch)
tree4a2dfcaa16960e09f76af5c6845138c04b663fd9 /lib/dfsan
parent31f1941f7e2ee9548a77fb19186960b9b8a0632a (diff)
[tests] Update to use lit_config and lit package, as appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/dfsan')
-rw-r--r--lib/dfsan/lit_tests/lit.cfg21
-rw-r--r--lib/dfsan/lit_tests/lit.site.cfg.in4
2 files changed, 14 insertions, 11 deletions
diff --git a/lib/dfsan/lit_tests/lit.cfg b/lib/dfsan/lit_tests/lit.cfg
index 0daface1e..19bc97690 100644
--- a/lib/dfsan/lit_tests/lit.cfg
+++ b/lib/dfsan/lit_tests/lit.cfg
@@ -2,12 +2,15 @@
import os
+import lit.util
+
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)
+ lit_config.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.
@@ -17,9 +20,9 @@ config.name = 'DataFlowSanitizer'
config.test_source_root = os.path.dirname(__file__)
def DisplayNoConfigMessage():
- lit.fatal("No site specific configuration available! " +
- "Try running your test from the build tree or running " +
- "make check-dfsan")
+ lit_config.fatal("No site specific configuration available! " +
+ "Try running your test from the build tree or running " +
+ "make check-dfsan")
# Figure out LLVM source root.
llvm_src_root = getattr(config, 'llvm_src_root', None)
@@ -27,9 +30,9 @@ if llvm_src_root is None:
# We probably haven't loaded the site-specific configuration: the user
# is likely trying to run a test file directly, and the site configuration
# wasn't created by the build system.
- dfsan_site_cfg = lit.params.get('dfsan_site_config', None)
+ dfsan_site_cfg = lit_config.params.get('dfsan_site_config', None)
if (dfsan_site_cfg) and (os.path.exists(dfsan_site_cfg)):
- lit.load_config(config, dfsan_site_cfg)
+ lit_config.load_config(config, dfsan_site_cfg)
raise SystemExit
# Try to guess the location of site-specific configuration using llvm-config
@@ -45,7 +48,7 @@ if llvm_src_root is None:
if (not dfsan_site_cfg) or (not os.path.exists(dfsan_site_cfg)):
DisplayNoConfigMessage()
- lit.load_config(config, dfsan_site_cfg)
+ lit_config.load_config(config, dfsan_site_cfg)
raise SystemExit
# Setup default compiler flags used with -fsanitize=dataflow option.
diff --git a/lib/dfsan/lit_tests/lit.site.cfg.in b/lib/dfsan/lit_tests/lit.site.cfg.in
index d9eb836b9..0cf6d6b55 100644
--- a/lib/dfsan/lit_tests/lit.site.cfg.in
+++ b/lib/dfsan/lit_tests/lit.site.cfg.in
@@ -1,5 +1,5 @@
# Load common config for all compiler-rt lit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Load tool-specific config that would do the real work.
-lit.load_config(config, "@DFSAN_SOURCE_DIR@/lit_tests/lit.cfg")
+lit_config.load_config(config, "@DFSAN_SOURCE_DIR@/lit_tests/lit.cfg")