diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-02-23 04:44:54 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-02-23 11:56:46 +0530 |
commit | 62c7dcf32d1043fa939a1fade0610fec7b6b1b3d (patch) | |
tree | eb31cc5a83b995ec4a9ef9415d90a7701032b1d5 /mesontest.py | |
parent | 95248f0f26dc89efcbb62675bcb656e028c5444b (diff) | |
download | meson-62c7dcf32d1043fa939a1fade0610fec7b6b1b3d.zip meson-62c7dcf32d1043fa939a1fade0610fec7b6b1b3d.tar.gz meson-62c7dcf32d1043fa939a1fade0610fec7b6b1b3d.tar.bz2 |
mesontest: Use shlex.split for parsing the wrapper
Allows people to pass arguments with spaces in them. Do this using
argparse itself instead of doing an isinstance later.
Diffstat (limited to 'mesontest.py')
-rwxr-xr-x | mesontest.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mesontest.py b/mesontest.py index 980fbee..ef5cff6 100755 --- a/mesontest.py +++ b/mesontest.py @@ -16,6 +16,7 @@ # A tool to run tests in many different ways. +import shlex import subprocess, sys, os, argparse import pickle from mesonbuild import build @@ -61,7 +62,7 @@ parser.add_argument('--gdb', default=False, dest='gdb', action='store_true', help='Run test under gdb.') parser.add_argument('--list', default=False, dest='list', action='store_true', help='List available tests.') -parser.add_argument('--wrapper', default=None, dest='wrapper', +parser.add_argument('--wrapper', default=None, dest='wrapper', type=shlex.split, help='wrapper to run tests with (e.g. Valgrind)') parser.add_argument('-C', default='.', dest='wd', help='directory to cd into before running') @@ -421,10 +422,7 @@ TIMEOUT: %4d if self.options.repeat > 1: wrap += ['-ex', 'run', '-ex', 'quit'] elif self.options.wrapper: - if isinstance(self.options.wrapper, str): - wrap = self.options.wrapper.split() - else: - wrap = self.options.wrapper + wrap += self.options.wrapper assert(isinstance(wrap, list)) return wrap |