summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/test/Unit/lit.cfg5
-rw-r--r--clang-tools-extra/test/Unit/lit.site.cfg.in1
-rw-r--r--clang/test/Unit/lit.cfg5
-rw-r--r--llvm/test/Unit/lit.cfg5
4 files changed, 16 insertions, 0 deletions
diff --git a/clang-tools-extra/test/Unit/lit.cfg b/clang-tools-extra/test/Unit/lit.cfg
index eccb5b3289d..2c0760d83b1 100644
--- a/clang-tools-extra/test/Unit/lit.cfg
+++ b/clang-tools-extra/test/Unit/lit.cfg
@@ -12,6 +12,11 @@ if extra_tools_obj_dir is not None:
config.test_source_root = extra_tools_obj_dir
config.test_exec_root = config.test_source_root
+# Win32 seeks DLLs along %PATH%.
+if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
+ config.environment['PATH'] = os.path.pathsep.join((
+ config.shlibdir, config.environment['PATH']))
+
# All GoogleTests are named to have 'Tests' as their suffix. The '.' option is
# a special value for GoogleTest indicating that it should look through the
# entire testsuite recursively for tests (alternatively, one could provide a
diff --git a/clang-tools-extra/test/Unit/lit.site.cfg.in b/clang-tools-extra/test/Unit/lit.site.cfg.in
index 781970d66c8..0171efce792 100644
--- a/clang-tools-extra/test/Unit/lit.site.cfg.in
+++ b/clang-tools-extra/test/Unit/lit.site.cfg.in
@@ -2,6 +2,7 @@
# Do not edit!
config.extra_tools_obj_dir = "@CLANG_TOOLS_BINARY_DIR@/unittests"
config.extra_tools_src_dir = "@CLANG_TOOLS_SOURCE_DIR@/unittests"
+config.shlibdir = "@SHLIBDIR@"
config.target_triple = "@TARGET_TRIPLE@"
# Make sure any custom vars defined above that are required in lit.local.cfg
diff --git a/clang/test/Unit/lit.cfg b/clang/test/Unit/lit.cfg
index d34a01c9f9f..4fa6e78ed63 100644
--- a/clang/test/Unit/lit.cfg
+++ b/clang/test/Unit/lit.cfg
@@ -100,4 +100,9 @@ if not llvm_libs_dir:
lit_config.fatal('No LLVM libs dir set!')
shlibpath = os.path.pathsep.join((llvm_libs_dir,
config.environment.get(shlibpath_var,'')))
+
+# Win32 seeks DLLs along %PATH%.
+if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
+ shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
+
config.environment[shlibpath_var] = shlibpath
diff --git a/llvm/test/Unit/lit.cfg b/llvm/test/Unit/lit.cfg
index 04e88306881..e481dcc6a7b 100644
--- a/llvm/test/Unit/lit.cfg
+++ b/llvm/test/Unit/lit.cfg
@@ -35,6 +35,11 @@ for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
if symbolizer in os.environ:
config.environment[symbolizer] = os.environ[symbolizer]
+# Win32 seeks DLLs along %PATH%.
+if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
+ config.environment['PATH'] = os.path.pathsep.join((
+ config.shlibdir, config.environment['PATH']))
+
###
# Check that the object root is known.
OpenPOWER on IntegriCloud