summaryrefslogtreecommitdiff
path: root/lit/Unit
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-01-19 10:06:29 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-19 10:06:29 +0000
commit94994d372d014ce4c8758b9605d63fae651bd8aa (patch)
tree51c0b708bd59f205d6b35cb2a8c24d62f0c33d77 /lit/Unit
parent39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff)
Notes
Diffstat (limited to 'lit/Unit')
-rw-r--r--lit/Unit/lit.cfg.py (renamed from lit/Unit/lit.cfg)9
-rw-r--r--lit/Unit/lit.site.cfg.py.in (renamed from lit/Unit/lit.site.cfg.in)7
2 files changed, 14 insertions, 2 deletions
diff --git a/lit/Unit/lit.cfg b/lit/Unit/lit.cfg.py
index 338adfd7bd9a..3633c73a1d40 100644
--- a/lit/Unit/lit.cfg
+++ b/lit/Unit/lit.cfg.py
@@ -3,8 +3,10 @@
# Configuration file for the 'lit' test runner.
import os
+import sys
import lit.formats
+from lit.llvm import llvm_config
# name: The name of this test suite.
config.name = 'lldb-Unit'
@@ -17,5 +19,12 @@ config.suffixes = []
config.test_source_root = os.path.join(config.lldb_obj_root, 'unittests')
config.test_exec_root = config.test_source_root
+# One of our unit tests dynamically links against python.dll, and on Windows
+# it needs to be able to find it at runtime. This is fine if Python is on your
+# system PATH, but if it's not, then this unit test executable will fail to run.
+# We can solve this by forcing the Python directory onto the system path here.
+llvm_config.with_system_environment('PATH')
+llvm_config.with_environment('PATH', os.path.dirname(sys.executable), append_path=True)
+
# testFormat: The test format to use to interpret tests.
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
diff --git a/lit/Unit/lit.site.cfg.in b/lit/Unit/lit.site.cfg.py.in
index 9c43172e61e0..0c629fdfaa56 100644
--- a/lit/Unit/lit.site.cfg.in
+++ b/lit/Unit/lit.site.cfg.py.in
@@ -1,6 +1,6 @@
@LIT_SITE_CFG_IN_HEADER@
-config.test_exec_root = "@LLVM_BINARY_DIR@"
+config.test_exec_root = "@LLDB_BINARY_DIR@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
@@ -22,5 +22,8 @@ except KeyError as e:
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
+import lit.llvm
+lit.llvm.initialize(lit_config, config)
+
# Let the main config do the real work.
-lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Unit/lit.cfg")
+lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Unit/lit.cfg.py")