Skip to content

Commit 53d1ab4

Browse files
committed
test.py can now filter on test category, e.g. net
1 parent 9142520 commit 53d1ab4

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

test/test.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def valid_tests(subfolder=None):
5959

6060
valid_tests = [ x for x in validate_all.valid_tests() if not x in args.skip ]
6161

62+
if subfolder:
63+
return [x for x in valid_tests if x.split('/')[0] == subfolder]
64+
6265
if args.tests:
6366
return [x for x in valid_tests if x.split("/")[-1] in args.tests]
6467

@@ -117,12 +120,15 @@ def wait_status(self):
117120

118121

119122

120-
def integration_tests():
123+
def integration_tests(subfolder=None):
121124
"""
122125
Loops over all valid tests as defined by ./validate_all.py. Runs them one by one and gives an update of the statuses at the end.
123126
"""
124127
global test_count
125-
valid = valid_tests()
128+
if subfolder:
129+
valid = valid_tests(subfolder)
130+
else:
131+
valid = valid_tests()
126132
if not valid:
127133
print pretty.WARNING("Integration tests skipped")
128134
return 0
@@ -222,19 +228,18 @@ def main():
222228
test_folders = []
223229
tests_combined = test_categories + test_folders
224230
if args.tests:
225-
test_categories = [x for x in tests_combined if x in args.tests ]
231+
test_categories = [x for x in tests_combined if x in args.tests or x == "integration"]
226232
if args.skip:
227233
test_categories = [x for x in tests_combined if not x in args.skip]
228234

229-
print test_categories
230-
print valid_tests()
231235

232236
integration = integration_tests() if "integration" in test_categories else 0
233237
stress = stress_test() if "stress" in test_categories else 0
234238
unit = unit_tests() if "unit" in test_categories else 0
235239
examples = examples_working() if "examples" in test_categories else 0
240+
folders = integration_tests(subfolder=args.tests[0]) if args.tests[0] in test_categories else 0
236241

237-
status = max(integration, stress, unit, examples)
242+
status = max(integration, stress, unit, examples, folders)
238243

239244
if (not test_count):
240245
print "No tests selected"

0 commit comments

Comments
 (0)