From dad35dd311fd66f86befb167bd152a80591ac735 Mon Sep 17 00:00:00 2001 From: Johan Holmberg Date: Wed, 6 Jan 2016 20:33:08 +0100 Subject: [PATCH] accept directory command line argument then all CMDTEST_*.py files in the directory will be added --- python/cmdtest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/cmdtest.py b/python/cmdtest.py index 12bedb5..cab18e2 100755 --- a/python/cmdtest.py +++ b/python/cmdtest.py @@ -687,7 +687,9 @@ def parse_options(): py_files = [] selected_methods = set() for arg in options.arg: - if re.match(r'CMDTEST_.*\.py$', arg): + if os.path.isdir(arg): + py_files.extend(glob.glob('%s/CMDTEST_*.py' % arg)) + elif re.match(r'CMDTEST_.*\.py$', os.path.basename(arg)): py_files.append(arg) else: selected_methods.add(arg)