Skip to content

Commit e11c334

Browse files
Merge pull request #3702 from Apotell/regression
Regression script improvements
2 parents 0f9cf82 + 1f3a26a commit e11c334

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

scripts/regression.py

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@
2828
_this_filepath = os.path.realpath(__file__)
2929
_default_workspace_dirpath = os.path.dirname(os.path.dirname(_this_filepath))
3030

31+
def _is_ci_build():
32+
return 'GITHUB_JOB' in os.environ
33+
3134
# Except for the workspace dirpath all paths are expected to be relative
3235
# either to the workspace directory or the build directory
3336
_default_test_dirpaths = [ 'tests', os.path.join('third_party', 'tests') ]
3437
_default_build_dirpath = 'build'
35-
# _default_build_dirpath = os.path.join('out', 'build', 'x64-Debug')
36-
# _default_build_dirpath = os.path.join('out', 'build', 'x64-Release')
37-
# _default_build_dirpath = os.path.join('out', 'build', 'x64-Clang-Debug')
38-
# _default_build_dirpath = os.path.join('out', 'build', 'x64-Clang-Release')
38+
39+
if not _is_ci_build():
40+
# _default_build_dirpath = os.path.join('out', 'build', 'x64-Debug')
41+
# _default_build_dirpath = os.path.join('out', 'build', 'x64-Release')
42+
# _default_build_dirpath = os.path.join('out', 'build', 'x64-Clang-Debug')
43+
# _default_build_dirpath = os.path.join('out', 'build', 'x64-Clang-Release')
44+
pass
45+
3946
_default_output_dirpath = 'regression'
4047
_default_surelog_filename = 'surelog.exe' if platform.system() == 'Windows' else 'surelog'
4148
_default_uhdm_dump_filename = 'uhdm-dump.exe' if platform.system() == 'Windows' else 'uhdm-dump'
@@ -57,6 +64,7 @@ def log(text, end='\n'):
5764
finally:
5865
_log_mutex.release()
5966

67+
6068
@unique
6169
class Status(Enum):
6270
PASS = 0
@@ -72,10 +80,6 @@ def __str__(self):
7280
return str(self.name)
7381

7482

75-
def _is_ci_build():
76-
return 'GITHUB_JOB' in os.environ
77-
78-
7983
def _get_platform_id():
8084
system = platform.system()
8185
if system == 'Linux':
@@ -1203,6 +1207,19 @@ def _main():
12031207
for dirpath in args.test_dirpaths
12041208
]
12051209

1210+
if args.filters:
1211+
filters = set()
1212+
for filter in args.filters:
1213+
if filter.startswith('@'):
1214+
with open(filter[1:], 'rt') as strm:
1215+
for line in strm:
1216+
line = line.strip()
1217+
if line:
1218+
filters.add(line.strip())
1219+
else:
1220+
filters.add(filter)
1221+
args.filters = filters
1222+
12061223
args.filters = [text if text.isalnum() else re.compile(text, re.IGNORECASE) for text in args.filters]
12071224
all_tests, filtered_tests, blacklisted_tests = _scan(args.test_dirpaths, args.filters, args.shard, args.num_shards)
12081225

0 commit comments

Comments
 (0)