summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/utils/lit/tests/lit.cfg13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/utils/lit/tests/lit.cfg b/llvm/utils/lit/tests/lit.cfg
index ebdcb5000b9..92f27b02188 100644
--- a/llvm/utils/lit/tests/lit.cfg
+++ b/llvm/utils/lit/tests/lit.cfg
@@ -36,9 +36,13 @@ else:
lit_path = os.path.join(config.test_source_root, '..')
# Required because some tests import the lit module
-llvm_config.with_environment('PYTHONPATH', lit_path, append_path=True)
+if llvm_config:
+ llvm_config.with_environment('PYTHONPATH', lit_path, append_path=True)
+else:
+ config.environment['PYTHONPATH'] = os.pathsep.join([lit_path])
# Add llvm and lit tools directories if this config is being loaded indirectly.
+# In this case, we can also expect llvm_config to have been imported correctly.
for attribute in ('llvm_tools_dir', 'lit_tools_dir'):
directory = getattr(config, attribute, None)
if directory:
@@ -64,3 +68,10 @@ else:
lit_config.warning('Setting a timeout per test not supported. ' + errormsg
+ ' Some tests will be skipped and the --timeout'
' command line argument will not work.')
+
+# When running the lit tests standalone, we want to define the same features
+# that the llvm_config defines. This means that the 'system-windows' feature
+# (and any others) need to match the names in llvm_config for consistency
+if not llvm_config:
+ if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
+ config.available_features.add('system-windows')
OpenPOWER on IntegriCloud