summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2013-09-03 23:32:55 +0000
committerDaniel Dunbar <daniel@zuster.org>2013-09-03 23:32:55 +0000
commit4b3e5f24ecedc075a3d9f1a5bdb77190a3a01f22 (patch)
treee46aa6b34045d11b4d362a4097ae3bf3e111fd0c /utils
parent36b00f394fb03bd276d9343592bd718ddf4be789 (diff)
downloadllvm-4b3e5f24ecedc075a3d9f1a5bdb77190a3a01f22.tar.gz
llvm-4b3e5f24ecedc075a3d9f1a5bdb77190a3a01f22.tar.bz2
llvm-4b3e5f24ecedc075a3d9f1a5bdb77190a3a01f22.tar.xz
[lit] Allow config files to pass arbitrary values to child configs.
- This aligns with how existing test suites end up wanting to use the local config files, conceptually it makes sense to consider them to be inherited. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/lit/lit/TestingConfig.py11
-rw-r--r--utils/lit/lit/discovery.py3
-rw-r--r--utils/lit/tests/Inputs/discovery/lit.cfg3
-rw-r--r--utils/lit/tests/Inputs/discovery/subdir/lit.local.cfg3
4 files changed, 8 insertions, 12 deletions
diff --git a/utils/lit/lit/TestingConfig.py b/utils/lit/lit/TestingConfig.py
index 3f198c69d6..d541539690 100644
--- a/utils/lit/lit/TestingConfig.py
+++ b/utils/lit/lit/TestingConfig.py
@@ -114,17 +114,6 @@ class TestingConfig:
self.available_features = set(available_features)
self.pipefail = pipefail
- def clone(self):
- # FIXME: Chain implementations?
- #
- # FIXME: Allow extra parameters?
- return TestingConfig(self, self.name, self.suffixes, self.test_format,
- self.environment, self.substitutions,
- self.unsupported,
- self.test_exec_root, self.test_source_root,
- self.excludes, self.available_features,
- self.pipefail)
-
def finish(self, litConfig):
"""finish() - Finish this config object, after loading is complete."""
diff --git a/utils/lit/lit/discovery.py b/utils/lit/lit/discovery.py
index 263e54694c..c3c0f283b5 100644
--- a/utils/lit/lit/discovery.py
+++ b/utils/lit/lit/discovery.py
@@ -2,6 +2,7 @@
Test discovery functions.
"""
+import copy
import os
import sys
@@ -90,7 +91,7 @@ def getLocalConfig(ts, path_in_suite, litConfig, cache):
# Otherwise, copy the current config and load the local configuration
# file into it.
- config = parent.clone()
+ config = copy.copy(parent)
if litConfig.debug:
litConfig.note('loading local config %r' % cfgpath)
config.load_from_path(cfgpath, litConfig)
diff --git a/utils/lit/tests/Inputs/discovery/lit.cfg b/utils/lit/tests/Inputs/discovery/lit.cfg
index 1c5436be53..c48ca0bc03 100644
--- a/utils/lit/tests/Inputs/discovery/lit.cfg
+++ b/utils/lit/tests/Inputs/discovery/lit.cfg
@@ -9,3 +9,6 @@ config.test_format = lit.formats.ShTest()
#
#config.test_source_root = None
#config.test_exec_root = None
+
+# Check that arbitrary config values are copied (tested by subdir/lit.local.cfg).
+config.an_extra_variable = False
diff --git a/utils/lit/tests/Inputs/discovery/subdir/lit.local.cfg b/utils/lit/tests/Inputs/discovery/subdir/lit.local.cfg
index 5ae6b3cd01..631cb602b0 100644
--- a/utils/lit/tests/Inputs/discovery/subdir/lit.local.cfg
+++ b/utils/lit/tests/Inputs/discovery/subdir/lit.local.cfg
@@ -1 +1,4 @@
config.suffixes = ['.py']
+
+# Check that the arbitrary config values in our parent was inherited.
+assert hasattr(config, 'an_extra_variable')