diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2013-09-03 23:32:55 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2013-09-03 23:32:55 +0000 |
| commit | dac381a323325e2e81907b5fa3eacfaeee2b6928 (patch) | |
| tree | a8ed24f3aea26a4b142b60845e72b6a530c06385 /llvm/utils/lit | |
| parent | b8e430d695d63702e0d33eaa1c89dfc2f7b63ddc (diff) | |
| download | bcm5719-llvm-dac381a323325e2e81907b5fa3eacfaeee2b6928.tar.gz bcm5719-llvm-dac381a323325e2e81907b5fa3eacfaeee2b6928.zip | |
[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.
llvm-svn: 189885
Diffstat (limited to 'llvm/utils/lit')
| -rw-r--r-- | llvm/utils/lit/lit/TestingConfig.py | 11 | ||||
| -rw-r--r-- | llvm/utils/lit/lit/discovery.py | 3 | ||||
| -rw-r--r-- | llvm/utils/lit/tests/Inputs/discovery/lit.cfg | 3 | ||||
| -rw-r--r-- | llvm/utils/lit/tests/Inputs/discovery/subdir/lit.local.cfg | 3 |
4 files changed, 8 insertions, 12 deletions
diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py index 3f198c69d61..d5415396906 100644 --- a/llvm/utils/lit/lit/TestingConfig.py +++ b/llvm/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/llvm/utils/lit/lit/discovery.py b/llvm/utils/lit/lit/discovery.py index 263e54694ca..c3c0f283b55 100644 --- a/llvm/utils/lit/lit/discovery.py +++ b/llvm/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/llvm/utils/lit/tests/Inputs/discovery/lit.cfg b/llvm/utils/lit/tests/Inputs/discovery/lit.cfg index 1c5436be534..c48ca0bc036 100644 --- a/llvm/utils/lit/tests/Inputs/discovery/lit.cfg +++ b/llvm/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/llvm/utils/lit/tests/Inputs/discovery/subdir/lit.local.cfg b/llvm/utils/lit/tests/Inputs/discovery/subdir/lit.local.cfg index 5ae6b3cd017..631cb602b0d 100644 --- a/llvm/utils/lit/tests/Inputs/discovery/subdir/lit.local.cfg +++ b/llvm/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') |

