diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-08-09 22:14:01 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-08-09 22:14:01 +0000 |
commit | a1b15b4af39b843ebb8545d295aa872829eb8187 (patch) | |
tree | 4a2dfcaa16960e09f76af5c6845138c04b663fd9 | |
parent | 31f1941f7e2ee9548a77fb19186960b9b8a0632a (diff) | |
download | compiler-rt-a1b15b4af39b843ebb8545d295aa872829eb8187.tar.gz compiler-rt-a1b15b4af39b843ebb8545d295aa872829eb8187.tar.bz2 compiler-rt-a1b15b4af39b843ebb8545d295aa872829eb8187.tar.xz |
[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
26 files changed, 120 insertions, 100 deletions
diff --git a/lib/asan/lit_tests/32bitConfig/lit.site.cfg.in b/lib/asan/lit_tests/32bitConfig/lit.site.cfg.in index 99496c2b..faef4e8c 100644 --- a/lib/asan/lit_tests/32bitConfig/lit.site.cfg.in +++ b/lib/asan/lit_tests/32bitConfig/lit.site.cfg.in @@ -2,12 +2,12 @@ # Do not edit! # 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") # Tool-specific config options. config.asan_source_dir = "@ASAN_SOURCE_DIR@" config.bits = "32" # Load tool-specific config that would do the real work. -lit.load_config(config, "@ASAN_SOURCE_DIR@/lit_tests/lit.cfg") +lit_config.load_config(config, "@ASAN_SOURCE_DIR@/lit_tests/lit.cfg") diff --git a/lib/asan/lit_tests/64bitConfig/lit.site.cfg.in b/lib/asan/lit_tests/64bitConfig/lit.site.cfg.in index 94b02288..a3599448 100644 --- a/lib/asan/lit_tests/64bitConfig/lit.site.cfg.in +++ b/lib/asan/lit_tests/64bitConfig/lit.site.cfg.in @@ -2,11 +2,11 @@ # Do not edit! # 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") # Tool-specific config options. config.asan_source_dir = "@ASAN_SOURCE_DIR@" config.bits = "64" # Load tool-specific config that would do the real work. -lit.load_config(config, "@ASAN_SOURCE_DIR@/lit_tests/lit.cfg") +lit_config.load_config(config, "@ASAN_SOURCE_DIR@/lit_tests/lit.cfg") diff --git a/lib/asan/lit_tests/Unit/lit.site.cfg.in b/lib/asan/lit_tests/Unit/lit.site.cfg.in index 6864c80f..0db09400 100644 --- a/lib/asan/lit_tests/Unit/lit.site.cfg.in +++ b/lib/asan/lit_tests/Unit/lit.site.cfg.in @@ -2,7 +2,7 @@ # Do not edit! # Load common config for all compiler-rt unit tests. -lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured") +lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured") # Setup config name. config.name = 'AddressSanitizer-Unit' diff --git a/lib/asan/lit_tests/lit.cfg b/lib/asan/lit_tests/lit.cfg index 815452dd..317ec6f1 100644 --- a/lib/asan/lit_tests/lit.cfg +++ b/lib/asan/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 = 'AddressSanitizer' + config.bits 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-asan") + lit_config.fatal("No site specific configuration available! " + + "Try running your test from the build tree or running " + + "make check-asan") # 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. - asan_site_cfg = lit.params.get('asan_site_config', None) + asan_site_cfg = lit_config.params.get('asan_site_config', None) if (asan_site_cfg) and (os.path.exists(asan_site_cfg)): - lit.load_config(config, asan_site_cfg) + lit_config.load_config(config, asan_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 asan_site_cfg) or (not os.path.exists(asan_site_cfg)): DisplayNoConfigMessage() - lit.load_config(config, asan_site_cfg) + lit_config.load_config(config, asan_site_cfg) raise SystemExit # Setup default compiler flags used with -fsanitize=address option. @@ -74,7 +77,7 @@ config.environment['ASAN_SYMBOLIZER_PATH'] = config.llvm_symbolizer_path asan_source_dir = get_required_attr(config, "asan_source_dir") asan_symbolize = os.path.join(asan_source_dir, "scripts", "asan_symbolize.py") if not os.path.exists(asan_symbolize): - lit.fatal("Can't find script on path %r" % asan_symbolize) + lit_config.fatal("Can't find script on path %r" % asan_symbolize) config.substitutions.append( ("%asan_symbolize", " " + asan_symbolize + " ") ) # Define CHECK-%os to check for OS-dependent output. diff --git a/lib/dfsan/lit_tests/lit.cfg b/lib/dfsan/lit_tests/lit.cfg index 0daface1..19bc9769 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 d9eb836b..0cf6d6b5 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") diff --git a/lib/lit.common.cfg b/lib/lit.common.cfg index b19d6870..4be69215 100644 --- a/lib/lit.common.cfg +++ b/lib/lit.common.cfg @@ -6,15 +6,17 @@ import os import platform +import lit.formats + # Setup test format execute_external = (platform.system() != 'Windows' - or lit.getBashPath() not in [None, ""]) + or lit_config.getBashPath() not in [None, ""]) config.test_format = lit.formats.ShTest(execute_external) # Setup clang binary. clang_path = getattr(config, 'clang', None) if (not clang_path) or (not os.path.exists(clang_path)): - lit.fatal("Can't find Clang on path %r" % clang_path) + lit_config.fatal("Can't find Clang on path %r" % clang_path) # Clear some environment variables that might affect Clang. possibly_dangerous_env_vars = ['COMPILER_PATH', 'RC_DEBUG_OPTIONS', @@ -36,7 +38,7 @@ for name in possibly_dangerous_env_vars: # Tweak PATH to include llvm tools dir. llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)): - lit.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir) + lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir) path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH'])) config.environment['PATH'] = path diff --git a/lib/lit.common.configured.in b/lib/lit.common.configured.in index f7c29f62..9827a685 100644 --- a/lib/lit.common.configured.in +++ b/lib/lit.common.configured.in @@ -16,10 +16,10 @@ config.compiler_rt_arch = "@COMPILER_RT_SUPPORTED_ARCH@" # LLVM tools dir can be passed in lit parameters, so try to # apply substitution. try: - config.llvm_tools_dir = config.llvm_tools_dir % lit.params + config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params except KeyError,e: key, = e.args - lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) + lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) # Setup attributes common for all compiler-rt projects. -lit.load_config(config, "@COMPILER_RT_SOURCE_DIR@/lib/lit.common.cfg") +lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/lib/lit.common.cfg") diff --git a/lib/lit.common.unit.configured.in b/lib/lit.common.unit.configured.in index 1eac25b2..88eeed1a 100644 --- a/lib/lit.common.unit.configured.in +++ b/lib/lit.common.unit.configured.in @@ -12,11 +12,11 @@ config.llvm_build_mode = "@LLVM_BUILD_MODE@" # LLVM tools dir and build mode can be passed in lit parameters, # so try to apply substitution. try: - config.llvm_tools_dir = config.llvm_tools_dir % lit.params - config.llvm_build_mode = config.llvm_build_mode % lit.params + config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params + config.llvm_build_mode = config.llvm_build_mode % lit_config.params except KeyError,e: key, = e.args - lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) + lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) # Setup attributes common for all compiler-rt unit tests. -lit.load_config(config, "@COMPILER_RT_SOURCE_DIR@/lib/lit.common.unit.cfg") +lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/lib/lit.common.unit.cfg") diff --git a/lib/lsan/lit_tests/AsanConfig/lit.cfg b/lib/lsan/lit_tests/AsanConfig/lit.cfg index eb242442..a7df8965 100644 --- a/lib/lsan/lit_tests/AsanConfig/lit.cfg +++ b/lib/lsan/lit_tests/AsanConfig/lit.cfg @@ -5,16 +5,17 @@ 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) + 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 lsan_lit_src_root = get_required_attr(config, "lsan_lit_src_root") lsan_lit_cfg = os.path.join(lsan_lit_src_root, "lit.common.cfg") if not os.path.exists(lsan_lit_cfg): - lit.fatal("Can't find common LSan lit config at: %r" % lsan_lit_cfg) -lit.load_config(config, lsan_lit_cfg) + lit_config.fatal("Can't find common LSan lit config at: %r" % lsan_lit_cfg) +lit_config.load_config(config, lsan_lit_cfg) config.name = 'LeakSanitizer-AddressSanitizer' diff --git a/lib/lsan/lit_tests/AsanConfig/lit.site.cfg.in b/lib/lsan/lit_tests/AsanConfig/lit.site.cfg.in index 4557d790..9cf6572c 100644 --- a/lib/lsan/lit_tests/AsanConfig/lit.site.cfg.in +++ b/lib/lsan/lit_tests/AsanConfig/lit.site.cfg.in @@ -1,8 +1,8 @@ # 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") # Tool-specific config options. config.lsan_lit_src_root = "@LSAN_LIT_SOURCE_DIR@" # Load tool-specific config that would do the real work. -lit.load_config(config, "@LSAN_LIT_SOURCE_DIR@/AsanConfig/lit.cfg") +lit_config.load_config(config, "@LSAN_LIT_SOURCE_DIR@/AsanConfig/lit.cfg") diff --git a/lib/lsan/lit_tests/LsanConfig/lit.cfg b/lib/lsan/lit_tests/LsanConfig/lit.cfg index bc1d5481..764bf922 100644 --- a/lib/lsan/lit_tests/LsanConfig/lit.cfg +++ b/lib/lsan/lit_tests/LsanConfig/lit.cfg @@ -5,16 +5,17 @@ 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) + 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 lsan_lit_src_root = get_required_attr(config, "lsan_lit_src_root") lsan_lit_cfg = os.path.join(lsan_lit_src_root, "lit.common.cfg") if not os.path.exists(lsan_lit_cfg): - lit.fatal("Can't find common LSan lit config at: %r" % lsan_lit_cfg) -lit.load_config(config, lsan_lit_cfg) + lit_config.fatal("Can't find common LSan lit config at: %r" % lsan_lit_cfg) +lit_config.load_config(config, lsan_lit_cfg) config.name = 'LeakSanitizer-Standalone' diff --git a/lib/lsan/lit_tests/LsanConfig/lit.site.cfg.in b/lib/lsan/lit_tests/LsanConfig/lit.site.cfg.in index 8bc5c41b..2a6d724c 100644 --- a/lib/lsan/lit_tests/LsanConfig/lit.site.cfg.in +++ b/lib/lsan/lit_tests/LsanConfig/lit.site.cfg.in @@ -1,8 +1,8 @@ # 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") # Tool-specific config options. config.lsan_lit_src_root = "@LSAN_LIT_SOURCE_DIR@" # Load tool-specific config that would do the real work. -lit.load_config(config, "@LSAN_LIT_SOURCE_DIR@/LsanConfig/lit.cfg") +lit_config.load_config(config, "@LSAN_LIT_SOURCE_DIR@/LsanConfig/lit.cfg") diff --git a/lib/lsan/lit_tests/Unit/lit.site.cfg.in b/lib/lsan/lit_tests/Unit/lit.site.cfg.in index efe80493..a3a4e9ad 100644 --- a/lib/lsan/lit_tests/Unit/lit.site.cfg.in +++ b/lib/lsan/lit_tests/Unit/lit.site.cfg.in @@ -2,7 +2,7 @@ # Do not edit! # Load common config for all compiler-rt unit tests. -lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured") +lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured") # Setup config name. config.name = 'LeakSanitizer-Unit' diff --git a/lib/lsan/lit_tests/lit.common.cfg b/lib/lsan/lit_tests/lit.common.cfg index d52f64cc..11a40b55 100644 --- a/lib/lsan/lit_tests/lit.common.cfg +++ b/lib/lsan/lit_tests/lit.common.cfg @@ -7,9 +7,10 @@ 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) + 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 source root. diff --git a/lib/msan/lit_tests/Unit/lit.site.cfg.in b/lib/msan/lit_tests/Unit/lit.site.cfg.in index 52e17133..8e67f557 100644 --- a/lib/msan/lit_tests/Unit/lit.site.cfg.in +++ b/lib/msan/lit_tests/Unit/lit.site.cfg.in @@ -2,7 +2,7 @@ # Do not edit! # Load common config for all compiler-rt unit tests. -lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured") +lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured") # Setup config name. config.name = 'MemorySanitizer-Unit' diff --git a/lib/msan/lit_tests/lit.cfg b/lib/msan/lit_tests/lit.cfg index bc19b740..093ad943 100644 --- a/lib/msan/lit_tests/lit.cfg +++ b/lib/msan/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 = 'MemorySanitizer' 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-msan") + lit_config.fatal("No site specific configuration available! " + + "Try running your test from the build tree or running " + + "make check-msan") # 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. - msan_site_cfg = lit.params.get('msan_site_config', None) + msan_site_cfg = lit_config.params.get('msan_site_config', None) if (msan_site_cfg) and (os.path.exists(msan_site_cfg)): - lit.load_config(config, msan_site_cfg) + lit_config.load_config(config, msan_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 msan_site_cfg) or (not os.path.exists(msan_site_cfg)): DisplayNoConfigMessage() - lit.load_config(config, msan_site_cfg) + lit_config.load_config(config, msan_site_cfg) raise SystemExit # Setup default compiler flags used with -fsanitize=memory option. diff --git a/lib/msan/lit_tests/lit.site.cfg.in b/lib/msan/lit_tests/lit.site.cfg.in index 25d378fa..946df778 100644 --- a/lib/msan/lit_tests/lit.site.cfg.in +++ b/lib/msan/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, "@MSAN_SOURCE_DIR@/lit_tests/lit.cfg") +lit_config.load_config(config, "@MSAN_SOURCE_DIR@/lit_tests/lit.cfg") diff --git a/lib/sanitizer_common/tests/lit.cfg b/lib/sanitizer_common/tests/lit.cfg index 303d56c9..07127460 100644 --- a/lib/sanitizer_common/tests/lit.cfg +++ b/lib/sanitizer_common/tests/lit.cfg @@ -5,16 +5,17 @@ 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) + 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 attributes common for all compiler-rt projects. compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root') compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib", "lit.common.unit.cfg") -lit.load_config(config, compiler_rt_lit_unit_cfg) +lit_config.load_config(config, compiler_rt_lit_unit_cfg) # Setup config name. config.name = 'SanitizerCommon-Unit' diff --git a/lib/sanitizer_common/tests/lit.site.cfg.in b/lib/sanitizer_common/tests/lit.site.cfg.in index 50485aa1..bcd69cf4 100644 --- a/lib/sanitizer_common/tests/lit.site.cfg.in +++ b/lib/sanitizer_common/tests/lit.site.cfg.in @@ -7,10 +7,10 @@ config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@" config.llvm_build_mode = "@LLVM_BUILD_MODE@" try: - config.llvm_build_mode = config.llvm_build_mode % lit.params + config.llvm_build_mode = config.llvm_build_mode % lit_config.params except KeyError,e: key, = e.args - lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) + lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) # Let the main config do the real work. -lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") +lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") diff --git a/lib/tsan/lit_tests/Unit/lit.cfg b/lib/tsan/lit_tests/Unit/lit.cfg index 1b8d1758..c7aa0c17 100644 --- a/lib/tsan/lit_tests/Unit/lit.cfg +++ b/lib/tsan/lit_tests/Unit/lit.cfg @@ -5,9 +5,10 @@ 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) + 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. diff --git a/lib/tsan/lit_tests/Unit/lit.site.cfg.in b/lib/tsan/lit_tests/Unit/lit.site.cfg.in index 964da91e..3701a2ca 100644 --- a/lib/tsan/lit_tests/Unit/lit.site.cfg.in +++ b/lib/tsan/lit_tests/Unit/lit.site.cfg.in @@ -2,7 +2,7 @@ # Do not edit! # Load common config for all compiler-rt unit tests. -lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured") +lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured") # Load tool-specific config that would do the real work. -lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/Unit/lit.cfg") +lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/Unit/lit.cfg") diff --git a/lib/tsan/lit_tests/lit.cfg b/lib/tsan/lit_tests/lit.cfg index ce6c23a8..600290d2 100644 --- a/lib/tsan/lit_tests/lit.cfg +++ b/lib/tsan/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 = 'ThreadSanitizer' 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-tsan") + lit_config.fatal("No site specific configuration available! " + + "Try running your test from the build tree or running " + + "make check-tsan") # 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. - tsan_site_cfg = lit.params.get('tsan_site_config', None) + tsan_site_cfg = lit_config.params.get('tsan_site_config', None) if (tsan_site_cfg) and (os.path.exists(tsan_site_cfg)): - lit.load_config(config, tsan_site_cfg) + lit_config.load_config(config, tsan_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 tsan_site_cfg) or (not os.path.exists(tsan_site_cfg)): DisplayNoConfigMessage() - lit.load_config(config, tsan_site_cfg) + lit_config.load_config(config, tsan_site_cfg) raise SystemExit # Setup environment variables for running ThreadSanitizer. diff --git a/lib/tsan/lit_tests/lit.site.cfg.in b/lib/tsan/lit_tests/lit.site.cfg.in index a212393a..b0e42744 100644 --- a/lib/tsan/lit_tests/lit.site.cfg.in +++ b/lib/tsan/lit_tests/lit.site.cfg.in @@ -2,7 +2,7 @@ # Do not edit! # 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, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") +lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") diff --git a/lib/ubsan/lit_tests/lit.cfg b/lib/ubsan/lit_tests/lit.cfg index f3fc6464..6714a56c 100644 --- a/lib/ubsan/lit_tests/lit.cfg +++ b/lib/ubsan/lit_tests/lit.cfg @@ -5,9 +5,10 @@ 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) + 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 +18,9 @@ config.name = 'UndefinedBehaviorSanitizer' 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-ubsan") + lit_config.fatal("No site specific configuration available! " + + "Try running your test from the build tree or running " + + "make check-ubsan") # Figure out LLVM source root. llvm_src_root = getattr(config, 'llvm_src_root', None) @@ -27,9 +28,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 or we're performing an out-of-tree build. - ubsan_site_cfg = lit.params.get('ubsan_site_config', None) + ubsan_site_cfg = lit_config.params.get('ubsan_site_config', None) if ubsan_site_cfg and os.path.exists(ubsan_site_cfg): - lit.load_config(config, ubsan_site_cfg) + lit_config.load_config(config, ubsan_site_cfg) raise SystemExit # Try to guess the location of site-specific configuration using llvm-config @@ -45,7 +46,7 @@ if llvm_src_root is None: if not ubsan_site_cfg or not os.path.exists(ubsan_site_cfg): DisplayNoConfigMessage() - lit.load_config(config, ubsan_site_cfg) + lit_config.load_config(config, ubsan_site_cfg) raise SystemExit # Define %clang substitution to use in test RUN lines. diff --git a/lib/ubsan/lit_tests/lit.site.cfg.in b/lib/ubsan/lit_tests/lit.site.cfg.in index a212393a..b0e42744 100644 --- a/lib/ubsan/lit_tests/lit.site.cfg.in +++ b/lib/ubsan/lit_tests/lit.site.cfg.in @@ -2,7 +2,7 @@ # Do not edit! # 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, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") +lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") |