From b83084f5ca5b6175425c3b7f6977e9d8f6d9d04a Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 18 Dec 2017 18:29:40 -0500 Subject: [PATCH] tests/utils/python/testrunner.py: add optional pattern argument Add an optional command-line argument (second) to `testrunner.py`: the test file name pattern. You can use this argument to run only specific files in a given test directory, instead of the default which is `test*.py`. Signed-off-by: Philippe Proulx --- tests/utils/python/testrunner.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/utils/python/testrunner.py b/tests/utils/python/testrunner.py index ef1872fa3..175c8fd18 100644 --- a/tests/utils/python/testrunner.py +++ b/tests/utils/python/testrunner.py @@ -27,7 +27,13 @@ import sys if __name__ == '__main__': loader = unittest.TestLoader() - tests = loader.discover(sys.argv[1]) + + if len(sys.argv) >= 3: + pattern = sys.argv[2] + else: + pattern = 'test*.py' + + tests = loader.discover(sys.argv[1], pattern) runner = TAPTestRunner() runner.set_stream(True) runner.set_format('{method_name}') -- 2.34.1