summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/lit')
-rw-r--r--llvm/utils/lit/lit/discovery.py16
-rw-r--r--llvm/utils/lit/tests/lit.cfg5
2 files changed, 17 insertions, 4 deletions
diff --git a/llvm/utils/lit/lit/discovery.py b/llvm/utils/lit/lit/discovery.py
index 8876dcba8f2..3b5d0517cff 100644
--- a/llvm/utils/lit/lit/discovery.py
+++ b/llvm/utils/lit/lit/discovery.py
@@ -40,6 +40,20 @@ def getTestSuite(item, litConfig, cache):
ts, relative = search(parent)
return (ts, relative + (base,))
+ # This is a private builtin parameter which can be used to perform
+ # translation of configuration paths. Specifically, this parameter
+ # can be set to a dictionary that the discovery process will consult
+ # when it finds a configuration it is about to load. If the given
+ # path is in the map, the value of that key is a path to the
+ # configuration to load instead.
+ config_map = litConfig.params.get('config_map')
+ if config_map:
+ cfgpath = os.path.normpath(cfgpath)
+ cfgpath = os.path.normcase(cfgpath)
+ target = config_map.get(cfgpath)
+ if target:
+ cfgpath = target
+
# We found a test suite, create a new config for it and load it.
if litConfig.debug:
litConfig.note('loading suite config %r' % cfgpath)
@@ -212,7 +226,7 @@ def find_tests_for_inputs(lit_config, inputs):
f.close()
else:
actual_inputs.append(input)
-
+
# Load the tests from the inputs.
tests = []
test_suite_cache = {}
diff --git a/llvm/utils/lit/tests/lit.cfg b/llvm/utils/lit/tests/lit.cfg
index 0c98299285a..f2ecaa6d417 100644
--- a/llvm/utils/lit/tests/lit.cfg
+++ b/llvm/utils/lit/tests/lit.cfg
@@ -65,7 +65,6 @@ if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
config.available_features.add('windows')
# Add llvm tools directory if this config is being loaded indirectly
-llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
-if llvm_tools_dir != None:
- path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
+if config.llvm_tools_dir is not None:
+ path = os.path.pathsep.join((config.llvm_tools_dir, config.environment['PATH']))
config.environment['PATH'] = path
OpenPOWER on IntegriCloud