[llvm-commits] [compiler-rt] r161411 - in /compiler-rt/trunk/lib: asan/lit_tests/lit.site.cfg.in lit.common.cfg
Alexey Samsonov
samsonov at google.com
Tue Aug 7 04:00:19 PDT 2012
Author: samsonov
Date: Tue Aug 7 06:00:19 2012
New Revision: 161411
URL: http://llvm.org/viewvc/llvm-project?rev=161411&view=rev
Log:
[ASan] add llvm_tools_dir to lit.site.cfg for ASan and add it to PATH
Modified:
compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in
compiler-rt/trunk/lib/lit.common.cfg
Modified: compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in?rev=161411&r1=161410&r2=161411&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/lit.site.cfg.in Tue Aug 7 06:00:19 2012
@@ -3,7 +3,16 @@
config.target_triple = "@TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
+# 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.
lit.load_config(config, "@ASAN_SOURCE_DIR@/lit_tests/lit.cfg")
Modified: compiler-rt/trunk/lib/lit.common.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lit.common.cfg?rev=161411&r1=161410&r2=161411&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lit.common.cfg (original)
+++ compiler-rt/trunk/lib/lit.common.cfg Tue Aug 7 06:00:19 2012
@@ -35,6 +35,13 @@
if name in config.environment:
del config.environment[name]
+# 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)
+path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
+config.environment['PATH'] = path
+
# Define %clang substitution to use in test RUN lines.
config.substitutions.append( ("%clang ", (" " + config.clang + " ")) )
More information about the llvm-commits
mailing list