diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-02-23 04:51:10 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-02-23 11:56:46 +0530 |
commit | f5b43eef1b9b9a82b24fd7fd05e78af257ed7f4d (patch) | |
tree | ace0cfae23e1607f9add20dd7f07347a1f983116 /mesontest.py | |
parent | 9fffcef290a84e398dc2b9cdbac0bdfcdd60961a (diff) | |
download | meson-f5b43eef1b9b9a82b24fd7fd05e78af257ed7f4d.zip meson-f5b43eef1b9b9a82b24fd7fd05e78af257ed7f4d.tar.gz meson-f5b43eef1b9b9a82b24fd7fd05e78af257ed7f4d.tar.bz2 |
mesontest: Support passing test arguments at runtime
This is especially useful with the glib testing framework where you
can select which tests to run within a single test executable by
pasing `-p /some/test/path`
Diffstat (limited to 'mesontest.py')
-rwxr-xr-x | mesontest.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mesontest.py b/mesontest.py index 0cccfe2..a1708e3 100755 --- a/mesontest.py +++ b/mesontest.py @@ -90,7 +90,10 @@ parser.add_argument('-t', '--timeout-multiplier', type=float, default=None, ' more time to execute.') parser.add_argument('--setup', default=None, dest='setup', help='Which test setup to use.') -parser.add_argument('args', nargs='*') +parser.add_argument('--test-args', default=[], type=shlex.split, + help='Arguments to pass to the specified test(s) or all tests') +parser.add_argument('args', nargs='*', + help='Optional list of tests to run') class TestRun: def __init__(self, res, returncode, should_fail, duration, stdo, stde, cmd, @@ -190,7 +193,7 @@ class TestHarness: stde = None returncode = GNU_SKIP_RETURNCODE else: - cmd = wrap + cmd + test.cmd_args + cmd = wrap + cmd + test.cmd_args + self.options.test_args starttime = time.time() child_env = os.environ.copy() child_env.update(self.options.global_env.get_env(child_env)) |