|
@@ -71,13 +71,27 @@ def gather_tests(include = [], exclude=[], benchmarker=None):
|
|
# Find all tests in the config file
|
|
# Find all tests in the config file
|
|
config_tests = framework_test.parse_config(config,
|
|
config_tests = framework_test.parse_config(config,
|
|
os.path.dirname(config_file_name), benchmarker)
|
|
os.path.dirname(config_file_name), benchmarker)
|
|
-
|
|
|
|
|
|
+
|
|
# Filter
|
|
# Filter
|
|
for test in config_tests:
|
|
for test in config_tests:
|
|
- if test.name in exclude:
|
|
|
|
|
|
+ if len(include) is 0 and len(exclude) is 0:
|
|
|
|
+ # No filters, we are running everything
|
|
|
|
+ tests.append(test)
|
|
|
|
+ elif test.name in exclude:
|
|
continue
|
|
continue
|
|
- elif len(include) is 0 or test.name in include:
|
|
|
|
|
|
+ elif test.name in include:
|
|
tests.append(test)
|
|
tests.append(test)
|
|
|
|
+ else:
|
|
|
|
+ # An include list exists, but this test is
|
|
|
|
+ # not listed there, so we ignore it
|
|
|
|
+ pass
|
|
|
|
+
|
|
|
|
+ # Ensure we were able to locate everything that was
|
|
|
|
+ # explicitly included
|
|
|
|
+ names = {test.name for test in tests}
|
|
|
|
+ if 0 != len(set(include) - set(names)):
|
|
|
|
+ missing = list(set(include) - set(names))
|
|
|
|
+ raise Exception("Unable to locate tests %s" % missing)
|
|
|
|
|
|
tests.sort(key=lambda x: x.name)
|
|
tests.sort(key=lambda x: x.name)
|
|
return tests
|
|
return tests
|