diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2015-06-01 17:50:03 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2015-06-01 17:50:03 +0000 |
commit | f4d5a8ec9ee6af75a271b517b74f38b7a5c6f18a (patch) | |
tree | ccb2b1365f7828c8b501f102cf8ee9eb29aef20a /llvm/utils/lit | |
parent | 5e3ab2b95f4c1183fe43b3057791678ed1847b9a (diff) | |
download | bcm5719-llvm-f4d5a8ec9ee6af75a271b517b74f38b7a5c6f18a.tar.gz bcm5719-llvm-f4d5a8ec9ee6af75a271b517b74f38b7a5c6f18a.zip |
lit: Allow configurations to restrict the set of tests to run
By setting limit_to_features to a non empty list of features a configuration can
restrict the set of tests to run to only include tests that require a feature in
this list.
rdar://21082253
llvm-svn: 238766
Diffstat (limited to 'llvm/utils/lit')
-rw-r--r-- | llvm/utils/lit/lit/TestRunner.py | 9 | ||||
-rw-r--r-- | llvm/utils/lit/lit/TestingConfig.py | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py index f1734eca372..70382b472f5 100644 --- a/llvm/utils/lit/lit/TestRunner.py +++ b/llvm/utils/lit/lit/TestRunner.py @@ -513,6 +513,15 @@ def parseIntegratedTestScript(test, normalize_slashes=False, return lit.Test.Result(Test.UNSUPPORTED, "Test is unsupported with the following features: %s" % msg) + if test.config.limit_to_features: + # Check that we have one of the limit_to_features features in requires. + limit_to_features_tests = [f for f in test.config.limit_to_features + if f in requires] + if not limit_to_features_tests: + msg = ', '.join(test.config.limit_to_features) + return lit.Test.Result(Test.UNSUPPORTED, + "Test requires one of the limit_to_features features %s" % msg) + return script,tmpBase,execdir def _runShTest(test, litConfig, useExternalSh, diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py index c7ef94dc11f..1d51c1cee97 100644 --- a/llvm/utils/lit/lit/TestingConfig.py +++ b/llvm/utils/lit/lit/TestingConfig.py @@ -118,7 +118,7 @@ class TestingConfig: def __init__(self, parent, name, suffixes, test_format, environment, substitutions, unsupported, test_exec_root, test_source_root, excludes, - available_features, pipefail): + available_features, pipefail, limit_to_features = []): self.parent = parent self.name = str(name) self.suffixes = set(suffixes) @@ -131,6 +131,10 @@ class TestingConfig: self.excludes = set(excludes) self.available_features = set(available_features) self.pipefail = pipefail + # This list is used by TestRunner.py to restrict running only tests that + # require one of the features in this list if this list is non-empty. + # Configurations can set this list to restrict the set of tests to run. + self.limit_to_features = set(limit_to_features) def finish(self, litConfig): """finish() - Finish this config object, after loading is complete.""" |