diff --git a/tools/runner.py b/tools/runner.py index bf28d9ad..8e9530a0 100644 --- a/tools/runner.py +++ b/tools/runner.py @@ -72,7 +72,10 @@ class RunnerNamespace(Namespace): if v in [None, False, [], '']: continue - ret += '%s=%s ' % (k, str(v)) + if type(v) is list: + ret += '%s=%s ' % (k, ','.join(v)) + else: + ret += '%s=%s ' % (k, str(v)) return ret.strip() @@ -89,7 +92,7 @@ class RunnerCoreArgParse(ArgumentParser): default=None, type=os.path.abspath) self.add_argument('--verbose', '-v', metavar='', - type=str, + type=lambda x: x.split(','), help='Comma separated list of applications', dest='verbose', default=[]) diff --git a/tools/utils.py b/tools/utils.py index 55db4227..d16f221f 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -8,7 +8,7 @@ import dbus from gi.repository import GLib from weakref import WeakValueDictionary -from glob import glob +from re import match from runner import RunnerCoreArgParse @@ -95,10 +95,13 @@ class Process(subprocess.Popen): if process == 'valgrind' and 'iwd' in Process.testargs.verbose: return True - # Handle any glob matches + # Handle any regex matches for item in Process.testargs.verbose: - if process in glob(item): - return True + try: + if match(item, process): + return True + except Exception as e: + print("%s is not a valid regex" % item) return False