Define the path to llvm-symbolizer tool in a common config to reduce copy-paste

llvm-svn: 185286
This commit is contained in:
Alexey Samsonov 2013-06-30 14:47:38 +00:00
parent 39a2c197cf
commit e71f37c1cd
5 changed files with 7 additions and 17 deletions

View File

@ -67,10 +67,7 @@ config.substitutions.append( ("%clangxx_asan ", (" " + config.clang + " " +
clang_asan_cxxflags + " ")) )
# Setup path to external LLVM symbolizer to run AddressSanitizer output tests.
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
if llvm_tools_dir:
config.environment['ASAN_SYMBOLIZER_PATH'] = os.path.join(
llvm_tools_dir, "llvm-symbolizer")
config.environment['ASAN_SYMBOLIZER_PATH'] = config.llvm_symbolizer_path
# Define CHECK-%os to check for OS-dependent output.
config.substitutions.append( ('CHECK-%os', ("CHECK-" + config.host_os)))

View File

@ -40,6 +40,9 @@ if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)):
path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
config.environment['PATH'] = path
# Define path to external llvm-symbolizer tool.
config.llvm_symbolizer_path = os.path.join(llvm_tools_dir, "llvm-symbolizer")
# Use ugly construction to explicitly prohibit "clang", "clang++" etc.
# in RUN lines.
config.substitutions.append(

View File

@ -12,10 +12,6 @@ def get_required_attr(config, attr_name):
"to lit.site.cfg " % attr_name)
return attr_value
# Setup path to external LLVM symbolizer to run LeakSanitizer output tests.
llvm_tools_dir = get_required_attr(config, 'llvm_tools_dir')
config.llvm_symbolizer_path = os.path.join(llvm_tools_dir, "llvm-symbolizer")
# 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')

View File

@ -63,10 +63,7 @@ config.substitutions.append( ("%clangxx_msan ",
" ") )
# Setup path to external LLVM symbolizer to run MemorySanitizer output tests.
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
if llvm_tools_dir:
llvm_symbolizer_path = os.path.join(llvm_tools_dir, "llvm-symbolizer")
config.environment['MSAN_SYMBOLIZER_PATH'] = llvm_symbolizer_path
config.environment['MSAN_SYMBOLIZER_PATH'] = config.llvm_symbolizer_path
# Default test suffixes.
config.suffixes = ['.c', '.cc', '.cpp']

View File

@ -50,11 +50,8 @@ if llvm_src_root is None:
# Setup environment variables for running ThreadSanitizer.
tsan_options = "atexit_sleep_ms=0"
# Get path to external LLVM symbolizer to run ThreadSanitizer output tests.
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
if llvm_tools_dir:
llvm_symbolizer_path = os.path.join(llvm_tools_dir, "llvm-symbolizer")
tsan_options += " " + "external_symbolizer_path=" + llvm_symbolizer_path
# Set path to external LLVM symbolizer to run ThreadSanitizer output tests.
tsan_options += " " + "external_symbolizer_path=" + config.llvm_symbolizer_path
config.environment['TSAN_OPTIONS'] = tsan_options