|
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
|
@@ -40,6 +41,25 @@ def run_utc_tool(utc_name, utc_tool, testname):
|
40 | 41 | return (result.returncode, result.stdout, result.stderr)
|
41 | 42 |
|
42 | 43 |
|
| 44 | +def read_arguments_from_file(filename): |
| 45 | + try: |
| 46 | + with open(filename, "r") as file: |
| 47 | + return [line.rstrip() for line in file.readlines()] |
| 48 | + except FileNotFoundError: |
| 49 | + print(f"Error: File '{filename}' not found.") |
| 50 | + sys.exit(1) |
| 51 | + |
| 52 | + |
| 53 | +def expand_listfile_args(arg_list): |
| 54 | + exp_arg_list = [] |
| 55 | + for arg in arg_list: |
| 56 | + if arg.startswith("@"): |
| 57 | + exp_arg_list += read_arguments_from_file(arg[1:]) |
| 58 | + else: |
| 59 | + exp_arg_list.append(arg) |
| 60 | + return exp_arg_list |
| 61 | + |
| 62 | + |
43 | 63 | def main():
|
44 | 64 | from argparse import RawTextHelpFormatter
|
45 | 65 |
|
@@ -72,10 +92,12 @@ def main():
|
72 | 92 | utc_tools = {}
|
73 | 93 | have_error = False
|
74 | 94 |
|
| 95 | + tests = expand_listfile_args(config.tests) |
| 96 | + |
75 | 97 | with ThreadPoolExecutor(max_workers=config.jobs) as executor:
|
76 | 98 | jobs = []
|
77 | 99 |
|
78 |
| - for testname in config.tests: |
| 100 | + for testname in tests: |
79 | 101 | with open(testname, "r") as f:
|
80 | 102 | header = f.readline().strip()
|
81 | 103 | m = RE_ASSERTIONS.search(header)
|
|
0 commit comments