Skip to content

Commit 171b77f

Browse files
committed
test.py: Now only checks files defined by the test_categories global variable
1 parent f3c716c commit 171b77f

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

test/test.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
startdir = os.getcwd()
1717

18+
test_categories = ['fs', 'hw', 'kernel', 'mod', 'net', 'performance', 'platform', 'stl', 'stress', 'util']
19+
1820
"""
1921
Script used for running all the valid tests in the terminal.
2022
"""
@@ -345,20 +347,30 @@ def check_valid(path):
345347
def find_leaf_nodes():
346348
""" Used to find all leaf nodes in the test directory,
347349
this is to help identify all possible test directories.
350+
Only looks in folders that actually store tests
348351
349352
Returns:
350353
List: list of string with path to all leaf nodes
351354
"""
355+
leaf_nodes = []
352356

357+
for dirpath, dirnames, filenames in os.walk('.'):
358+
if dirpath[2:].split('/')[0] in test_categories:
359+
if not dirnames:
360+
leaf_nodes.append(dirpath[2:])
353361

362+
return leaf_nodes
354363

355-
def main2():
356-
# Populate test objects
357-
valid_test_objects = [ Test(x) for x in validate_all.valid_tests() if not x in args.skip ]
358364

359-
for x in valid_test_objects:
360-
print x
365+
def main2():
366+
# Find leaf nodes
367+
leaves = find_leaf_nodes()
361368

369+
# Valid tests
370+
for path in leaves:
371+
print path, ' ', check_valid(path)
372+
# Populate test objects
373+
#valid_test_objects = [ Test(x) for x in leaves if not x in args.skip ]
362374

363375

364376
if __name__ == '__main__':

0 commit comments

Comments
 (0)