diff options
author | Andrew Trick <atrick@apple.com> | 2011-06-16 01:33:35 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-06-16 01:33:35 +0000 |
commit | 05c087d8934168f6dda429de5b0925a7be0cc9a3 (patch) | |
tree | 631a9da577f5eb8b8388c51c5155dacd0ae9a903 /utils/lit | |
parent | 6fce128dd1e160a5d2d11cddec336686ff1f8706 (diff) | |
download | external_llvm-05c087d8934168f6dda429de5b0925a7be0cc9a3.zip external_llvm-05c087d8934168f6dda429de5b0925a7be0cc9a3.tar.gz external_llvm-05c087d8934168f6dda429de5b0925a7be0cc9a3.tar.bz2 |
Add support to lit for build mode requirements. e.g.
REQUIRES: Asserts
REQUIRES: Debug
This required chaining test configuration properties. It seems like a
generally good thing to do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133131 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit')
-rw-r--r-- | utils/lit/lit/TestRunner.py | 6 | ||||
-rw-r--r-- | utils/lit/lit/TestingConfig.py | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py index 80d0ba1..83603cc 100644 --- a/utils/lit/lit/TestRunner.py +++ b/utils/lit/lit/TestRunner.py @@ -473,9 +473,11 @@ def parseIntegratedTestScript(test, normalize_slashes=False): if script[-1][-1] == '\\': return (Test.UNRESOLVED, "Test has unterminated run lines (with '\\')") - # Check that we have the required features: + # Check that we have the required features or build modes: missing_required_features = [f for f in requires - if f not in test.config.available_features] + if f not in test.config.available_features + and f not in test.config.llvm_build_modes] + if missing_required_features: msg = ', '.join(missing_required_features) return (Test.UNSUPPORTED, diff --git a/utils/lit/lit/TestingConfig.py b/utils/lit/lit/TestingConfig.py index 25bb341..2d8d3d0 100644 --- a/utils/lit/lit/TestingConfig.py +++ b/utils/lit/lit/TestingConfig.py @@ -74,6 +74,7 @@ class TestingConfig: def clone(self, path): # FIXME: Chain implementations? + # See attribute chaining in finish() # # FIXME: Allow extra parameters? cfg = TestingConfig(self, self.name, self.suffixes, self.test_format, @@ -101,3 +102,9 @@ class TestingConfig: # files. Should we distinguish them? self.test_source_root = str(self.test_source_root) self.excludes = set(self.excludes) + + # chain attributes by copying them + if self.parent: + for k,v in vars(self.parent).items(): + if not hasattr(self, k): + setattr(self, k, v) |