145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227 | def get_test_args() -> argparse.ArgumentParser:
"""
title: Get the CLI arguments for `arx test`.
returns:
type: argparse.ArgumentParser
"""
parser = argparse.ArgumentParser(
prog="arx test",
description="Discover, compile, and run Arx tests.",
formatter_class=CustomHelpFormatter,
)
parser.add_argument(
"paths",
nargs="*",
type=str,
help=(
"Test files or directories to discover tests in. "
"Directories are searched recursively for files matching the "
"configured file pattern. Defaults to `tests` (or the value "
"from [tests].paths in .arxproject.toml, if present)."
),
)
parser.add_argument(
"--list",
dest="list_only",
action="store_true",
help="List discovered tests without running them",
)
parser.add_argument(
"-k",
dest="name_filter",
default="",
type=str,
help="Run only tests whose names contain the given substring",
)
parser.add_argument(
"-x",
"--fail-fast",
dest="fail_fast",
action="store_true",
help="Stop after the first failing test",
)
parser.add_argument(
"--exclude",
dest="exclude",
action="append",
default=None,
type=str,
help=(
"Glob pattern to exclude from test discovery. Repeat the flag "
"to supply multiple patterns."
),
)
parser.add_argument(
"--file-pattern",
dest="file_pattern",
default=None,
type=str,
help="Glob pattern for test file discovery (default: test_*.x)",
)
parser.add_argument(
"--function-pattern",
dest="function_pattern",
default=None,
type=str,
help="Glob pattern for test function names (default: test_*)",
)
parser.add_argument(
"--keep-artifacts",
action="store_true",
help="Keep generated wrapper/debug artifacts and executables",
)
parser.add_argument(
"--link-mode",
type=str,
choices=("auto", "pie", "no-pie"),
default="auto",
help=(
"Set executable link mode for generated test binaries: "
"auto, pie, or no-pie."
),
)
return parser
|