Remove a bunch of copy-paste: use common config for sanitizer lit/unit tests

llvm-svn: 183407
This commit is contained in:
Alexey Samsonov 2013-06-06 13:28:37 +00:00
parent 5752dd46ac
commit e3bf521b7c
17 changed files with 39 additions and 172 deletions

View File

@ -3,7 +3,9 @@
# Generic config options for all compiler-rt lit tests.
config.target_triple = "@TARGET_TRIPLE@"
config.host_arch = "@HOST_ARCH@"
config.host_os = "@HOST_OS@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"

View File

@ -4,10 +4,15 @@
# Generic config options for all compiler-rt unit tests.
config.target_triple = "@TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
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
except KeyError,e:
key, = e.args

View File

@ -1,21 +1,8 @@
config.host_os = "@HOST_OS@"
config.host_arch = "@HOST_ARCH@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
config.compiler_rt_arch = "@COMPILER_RT_SUPPORTED_ARCH@"
# Load common config for all compiler-rt lit tests.
lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Tool-specific config options.
config.lsan_lit_src_root = "@LSAN_LIT_SOURCE_DIR@"
# 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
except KeyError,e:
key, = e.args
lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Let the main config do the real work.
# Load tool-specific config that would do the real work.
lit.load_config(config, "@LSAN_LIT_SOURCE_DIR@/AsanConfig/lit.cfg")

View File

@ -1,21 +1,8 @@
config.host_os = "@HOST_OS@"
config.host_arch = "@HOST_ARCH@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
config.compiler_rt_arch = "@COMPILER_RT_SUPPORTED_ARCH@"
# Load common config for all compiler-rt lit tests.
lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Tool-specific config options.
config.lsan_lit_src_root = "@LSAN_LIT_SOURCE_DIR@"
# 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
except KeyError,e:
key, = e.args
lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Let the main config do the real work.
# Load tool-specific config that would do the real work.
lit.load_config(config, "@LSAN_LIT_SOURCE_DIR@/LsanConfig/lit.cfg")

View File

@ -10,12 +10,6 @@ def get_required_attr(config, attr_name):
"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)
# Setup config name.
config.name = 'LeakSanitizer-Unit'

View File

@ -1,17 +1,11 @@
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
config.target_triple = "@TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
# Load common config for all compiler-rt unit tests.
lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
# Tool-specific config options.
config.lsan_binary_dir = "@LSAN_BINARY_DIR@"
try:
config.llvm_build_mode = config.llvm_build_mode % lit.params
except KeyError,e:
key, = e.args
lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Let the main config do the real work.
# Load tool-specific config that would do the real work.
lit.load_config(config, "@LSAN_SOURCE_DIR@/lit_tests/Unit/lit.cfg")

View File

@ -16,14 +16,6 @@ def get_required_attr(config, attr_name):
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 "

View File

@ -10,12 +10,6 @@ def get_required_attr(config, attr_name):
"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)
# Setup config name.
config.name = 'MemorySanitizer-Unit'

View File

@ -1,17 +1,11 @@
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
config.target_triple = "@TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
# Load common config for all compiler-rt unit tests.
lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
# Tool-specific config options.
config.msan_binary_dir = "@MSAN_BINARY_DIR@"
try:
config.llvm_build_mode = config.llvm_build_mode % lit.params
except KeyError,e:
key, = e.args
lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Let the main config do the real work.
# Load tool-specific config that would do the real work.
lit.load_config(config, "@MSAN_SOURCE_DIR@/lit_tests/Unit/lit.cfg")

View File

@ -48,15 +48,6 @@ if llvm_src_root is None:
lit.load_config(config, msan_site_cfg)
raise SystemExit
# 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)
# Setup default compiler flags used with -fsanitize=memory option.
clang_msan_cflags = ["-fsanitize=memory",
"-mno-omit-leaf-frame-pointer",

View File

@ -1,18 +1,5 @@
config.target_triple = "@TARGET_TRIPLE@"
config.host_os = "@HOST_OS@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
# Load common config for all compiler-rt lit tests.
lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# 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
except KeyError,e:
key, = e.args
lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Let the main config do the real work.
# Load tool-specific config that would do the real work.
lit.load_config(config, "@MSAN_SOURCE_DIR@/lit_tests/lit.cfg")

View File

@ -10,12 +10,6 @@ def get_required_attr(config, attr_name):
"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)
# Setup config name.
config.name = 'ThreadSanitizer-Unit'

View File

@ -1,20 +1,8 @@
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
# Load common config for all compiler-rt unit tests.
lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
# 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_build_mode = config.llvm_build_mode % lit.params
except KeyError,e:
key, = e.args
lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Let the main config do the real work.
# Load tool-specific config that would do the real work.
lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/Unit/lit.cfg")

View File

@ -48,15 +48,6 @@ if llvm_src_root is None:
lit.load_config(config, tsan_site_cfg)
raise SystemExit
# 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)
# Setup environment variables for running ThreadSanitizer.
tsan_options = "atexit_sleep_ms=0"
# Get path to external LLVM symbolizer to run ThreadSanitizer output tests.

View File

@ -1,20 +1,8 @@
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
config.host_os = "@HOST_OS@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
# Load common config for all compiler-rt lit tests.
lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# 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
except KeyError,e:
key, = e.args
lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Let the main config do the real work.
# Load tool-specific config that would do the real work.
lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")

View File

@ -48,15 +48,6 @@ if llvm_src_root is None:
lit.load_config(config, ubsan_site_cfg)
raise SystemExit
# 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)
# Default test suffixes.
config.suffixes = ['.c', '.cc', '.cpp']

View File

@ -1,20 +1,8 @@
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
config.host_os = "@HOST_OS@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
# Load common config for all compiler-rt lit tests.
lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# 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
except KeyError,e:
key, = e.args
lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Let the main config do the real work.
# Load tool-specific config that would do the real work.
lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")