|
4 | 4 |
|
5 | 5 | Given a list of test files, this script will invoke the correct
|
6 | 6 | update_test_checks-style script, skipping any tests which have not previously
|
7 |
| -had assertions autogenerated. |
| 7 | +had assertions autogenerated. If test name starts with '@' it's treated as |
| 8 | +a name of file containing test list. |
8 | 9 | """
|
9 | 10 |
|
10 | 11 | from __future__ import print_function
|
@@ -39,6 +40,22 @@ def run_utc_tool(utc_name, utc_tool, testname):
|
39 | 40 | )
|
40 | 41 | return (result.returncode, result.stdout, result.stderr)
|
41 | 42 |
|
| 43 | +def read_arguments_from_file(filename): |
| 44 | + try: |
| 45 | + with open(filename, 'r') as file: |
| 46 | + return [line.rstrip() for line in file.readlines()] |
| 47 | + except FileNotFoundError: |
| 48 | + print(f"Error: File '{filename}' not found.") |
| 49 | + sys.exit(1) |
| 50 | + |
| 51 | +def expand_listfile_args(arg_list): |
| 52 | + exp_arg_list = [] |
| 53 | + for arg in arg_list: |
| 54 | + if arg.startswith('@'): |
| 55 | + exp_arg_list += read_arguments_from_file(arg[1:]) |
| 56 | + else: |
| 57 | + exp_arg_list.append(testname) |
| 58 | + return exp_arg_list |
42 | 59 |
|
43 | 60 | def main():
|
44 | 61 | from argparse import RawTextHelpFormatter
|
@@ -72,10 +89,12 @@ def main():
|
72 | 89 | utc_tools = {}
|
73 | 90 | have_error = False
|
74 | 91 |
|
| 92 | + tests = expand_listfile_args(config.tests) |
| 93 | + |
75 | 94 | with ThreadPoolExecutor(max_workers=config.jobs) as executor:
|
76 | 95 | jobs = []
|
77 | 96 |
|
78 |
| - for testname in config.tests: |
| 97 | + for testname in tests: |
79 | 98 | with open(testname, "r") as f:
|
80 | 99 | header = f.readline().strip()
|
81 | 100 | m = RE_ASSERTIONS.search(header)
|
|
0 commit comments