diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-07-16 09:01:20 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-07-16 09:01:34 -0400 |
commit | 8f9725c83f1da5364354d2820696c84d542d3d37 (patch) | |
tree | 299f2f0f387bfd36dfab169ca49d54d2dc6bb78f /test | |
parent | 29082e8f40c360847882553ad1b3900e5e402688 (diff) | |
parent | 1a6242526093424947eb49f3416dc0c6bc9fc3a8 (diff) |
Merge #16390: qa: Add --filter option to test_runner.py
1a6242526093424947eb49f3416dc0c6bc9fc3a8 qa: Add --filter option to test_runner.py (João Barbosa)
Pull request description:
Allows to run functional tests like:
```sh
test/functional/test_runner.py --filter wallet
```
ACKs for top commit:
jonatack:
ACK 1a6242526093424947eb49f3416dc0c6bc9fc3a8
Tree-SHA512: 53199e01da3b2e0112843c1c68c69d8fd7fc9bb6a6cb45a81c324973c4824ebf5fef574f9efab81a64d52e397e25d979ae40f0eaba35afb771e80012768f0b08
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/test_runner.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 462547f44f..96786e41b4 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -234,6 +234,7 @@ def main(): parser.add_argument('--quiet', '-q', action='store_true', help='only print dots, results summary and failure logs') parser.add_argument('--tmpdirprefix', '-t', default=tempfile.gettempdir(), help="Root directory for datadirs") parser.add_argument('--failfast', action='store_true', help='stop execution after the first test failure') + parser.add_argument('--filter', help='filter scripts to run by regular expression') args, unknown_args = parser.parse_known_args() # args to be passed on always start with two dashes; tests are the remaining unknown args @@ -294,6 +295,9 @@ def main(): if not exclude_list: print("{}WARNING!{} Test '{}' not found in current test list.".format(BOLD[1], BOLD[0], exclude_test)) + if args.filter: + test_list = list(filter(re.compile(args.filter).search, test_list)) + if not test_list: print("No valid test scripts specified. Check that your test is in one " "of the test lists in test_runner.py, or run test_runner.py with no arguments to run all tests") |