15
15
16
16
17
17
class GoogleTest (TestFormat ):
18
- def __init__ (self , test_sub_dirs , test_suffix , run_under = []):
18
+ def __init__ (self , test_sub_dirs , test_suffix , run_under = [], test_prefix = None ):
19
19
self .seen_executables = set ()
20
20
self .test_sub_dirs = str (test_sub_dirs ).split (";" )
21
21
@@ -26,6 +26,7 @@ def __init__(self, test_sub_dirs, test_suffix, run_under=[]):
26
26
27
27
# Also check for .py files for testing purposes.
28
28
self .test_suffixes = {exe_suffix , test_suffix + ".py" }
29
+ self .test_prefixes = {test_prefix } if test_prefix else None
29
30
self .run_under = run_under
30
31
31
32
def get_num_tests (self , path , litConfig , localConfig ):
@@ -55,7 +56,9 @@ def getTestsInDirectory(self, testSuite, path_in_suite, litConfig, localConfig):
55
56
dir_path = os .path .join (source_path , subdir )
56
57
if not os .path .isdir (dir_path ):
57
58
continue
58
- for fn in lit .util .listdir_files (dir_path , suffixes = self .test_suffixes ):
59
+ for fn in lit .util .listdir_files (
60
+ dir_path , suffixes = self .test_suffixes , prefixes = self .test_prefixes
61
+ ):
59
62
# Discover the tests in this executable.
60
63
execpath = os .path .join (source_path , subdir , fn )
61
64
if execpath in self .seen_executables :
0 commit comments