1515
1616
1717class 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 ):
1919 self .seen_executables = set ()
2020 self .test_sub_dirs = str (test_sub_dirs ).split (";" )
2121
@@ -26,6 +26,7 @@ def __init__(self, test_sub_dirs, test_suffix, run_under=[]):
2626
2727 # Also check for .py files for testing purposes.
2828 self .test_suffixes = {exe_suffix , test_suffix + ".py" }
29+ self .test_prefixes = {test_prefix } if test_prefix else None
2930 self .run_under = run_under
3031
3132 def get_num_tests (self , path , litConfig , localConfig ):
@@ -55,7 +56,9 @@ def getTestsInDirectory(self, testSuite, path_in_suite, litConfig, localConfig):
5556 dir_path = os .path .join (source_path , subdir )
5657 if not os .path .isdir (dir_path ):
5758 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+ ):
5962 # Discover the tests in this executable.
6063 execpath = os .path .join (source_path , subdir , fn )
6164 if execpath in self .seen_executables :
0 commit comments