Skip to content

Commit 1a62425

Browse files
committed
qa: Add --filter option to test_runner.py
1 parent 4fcccda commit 1a62425

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/functional/test_runner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ def main():
234234
parser.add_argument('--quiet', '-q', action='store_true', help='only print dots, results summary and failure logs')
235235
parser.add_argument('--tmpdirprefix', '-t', default=tempfile.gettempdir(), help="Root directory for datadirs")
236236
parser.add_argument('--failfast', action='store_true', help='stop execution after the first test failure')
237+
parser.add_argument('--filter', help='filter scripts to run by regular expression')
237238
args, unknown_args = parser.parse_known_args()
238239

239240
# args to be passed on always start with two dashes; tests are the remaining unknown args
@@ -294,6 +295,9 @@ def main():
294295
if not exclude_list:
295296
print("{}WARNING!{} Test '{}' not found in current test list.".format(BOLD[1], BOLD[0], exclude_test))
296297

298+
if args.filter:
299+
test_list = list(filter(re.compile(args.filter).search, test_list))
300+
297301
if not test_list:
298302
print("No valid test scripts specified. Check that your test is in one "
299303
"of the test lists in test_runner.py, or run test_runner.py with no arguments to run all tests")

0 commit comments

Comments
 (0)