aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-07-01 09:53:03 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2022-07-11 22:48:08 +0300
commit48709dd2ea3d0ec49f44beb53fc321be726e3ed2 (patch)
treec97eac2b3bc39ca331bdbeefe9dee1c5cebf7f07
parent34fcb00ec072cef671dc9f822f8ce3ce5c8d843e (diff)
downloadmeson-48709dd2ea3d0ec49f44beb53fc321be726e3ed2.zip
meson-48709dd2ea3d0ec49f44beb53fc321be726e3ed2.tar.gz
meson-48709dd2ea3d0ec49f44beb53fc321be726e3ed2.tar.bz2
run_single_test: Allow passing extra args like run_project_test
So you can do things like `run_single_test.py <path> -- -Ddefault_library=both`
-rwxr-xr-xrun_single_test.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/run_single_test.py b/run_single_test.py
index 24ffd41..eb9c5bb 100755
--- a/run_single_test.py
+++ b/run_single_test.py
@@ -26,11 +26,14 @@ if T.TYPE_CHECKING:
case: pathlib.Path
subtests: T.List[int]
backend: str
+ extra_args: T.List[str]
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument('case', type=pathlib.Path, help='The test case to run')
+ parser.add_argument('extra_args', nargs='*',
+ help='arguments that are passed directly to Meson (remember to have -- before these).')
parser.add_argument('--subtest', type=int, action='append', dest='subtests', help='which subtests to run')
parser.add_argument('--backend', action='store', help="Which backend to use")
parser.add_argument('--cross-file', action='store', help='File describing cross compilation environment.')
@@ -56,7 +59,7 @@ def main() -> None:
return 'meson'
return ''
- results = [run_test(t, t.args, should_fail(t.path), args.use_tmpdir) for t in tests]
+ results = [run_test(t, t.args + args.extra_args, should_fail(t.path), args.use_tmpdir) for t in tests]
failed = False
for test, result in zip(tests, results):
if result is None: