summaryrefslogtreecommitdiffstats
path: root/test/Unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/Unit')
-rw-r--r--test/Unit/lit.cfg12
-rw-r--r--test/Unit/lit.site.cfg.in10
2 files changed, 19 insertions, 3 deletions
diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
index 5fe0732..3509296 100644
--- a/test/Unit/lit.cfg
+++ b/test/Unit/lit.cfg
@@ -21,15 +21,21 @@ if llvm_obj_root is not None:
llvm_build_mode = getattr(config, 'llvm_build_mode', "Debug")
config.test_format = lit.formats.GoogleTest(llvm_build_mode, 'Tests')
+# Propagate the temp directory. Windows requires this because it uses \Windows\
+# if none of these are present.
+if 'TMP' in os.environ:
+ config.environment['TMP'] = os.environ['TMP']
+if 'TEMP' in os.environ:
+ config.environment['TEMP'] = os.environ['TEMP']
+
###
# If necessary, point the dynamic loader at libLLVM.so.
if config.enable_shared:
- libdir = os.path.join(config.llvm_obj_root, config.llvm_build_mode, 'lib')
shlibpath = config.environment.get(config.shlibpath_var,'')
if shlibpath:
- shlibpath = ':' + shlibpath
- shlibpath = libdir + shlibpath
+ shlibpath = os.pathsep + shlibpath
+ shlibpath = config.shlibdir + shlibpath
config.environment[config.shlibpath_var] = shlibpath
# Check that the object root is known.
diff --git a/test/Unit/lit.site.cfg.in b/test/Unit/lit.site.cfg.in
index 51b5bc4..9643507 100644
--- a/test/Unit/lit.site.cfg.in
+++ b/test/Unit/lit.site.cfg.in
@@ -6,7 +6,17 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.llvmgcc_dir = "@LLVMGCCDIR@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.enable_shared = @ENABLE_SHARED@
+config.shlibdir = "@SHLIBDIR@"
config.shlibpath_var = "@SHLIBPATH_VAR@"
+# Support substitution of the tools_dir and build_mode with user parameters.
+# This is used when we can't determine the tool dir at configuration time.
+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.
lit.load_config(config, "@LLVM_SOURCE_DIR@/test/Unit/lit.cfg")
OpenPOWER on IntegriCloud