diff options
author | Daniel Latypov <dlatypov@google.com> | 2021-09-15 00:03:48 +0300 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2021-10-19 23:18:49 +0300 |
commit | a127b154a8f231709754b5d56a501163dd837459 (patch) | |
tree | c657ab89b418eff5c567eafea5f8ce36a6b806d3 /tools/testing/kunit | |
parent | b7cbaef303c7b9f26c647bcba72da04dd35396c4 (diff) | |
download | linux-a127b154a8f231709754b5d56a501163dd837459.tar.xz |
kunit: tool: allow filtering test cases via glob
Commit 1d71307a6f94 ("kunit: add unit test for filtering suites by
names") introduced the ability to filter which suites we run via glob.
This change extends it so we can also filter individual test cases
inside of suites as well.
This is quite useful when, e.g.
* trying to run just the tests cases you've just added or are working on
* trying to debug issues with test hermeticity
Examples:
$ ./tools/testing/kunit/kunit.py run --kunitconfig=lib/kunit '*exec*.parse*'
...
============================================================
======== [PASSED] kunit_executor_test ========
[PASSED] parse_filter_test
============================================================
Testing complete. 1 tests run. 0 failed. 0 crashed.
$ ./tools/testing/kunit/kunit.py run --kunitconfig=lib/kunit '*.no_matching_tests'
...
[ERROR] no tests run!
Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/kunit')
-rwxr-xr-x | tools/testing/kunit/kunit.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py index ac35c61f65f5..8fa2ccd4f88f 100755 --- a/tools/testing/kunit/kunit.py +++ b/tools/testing/kunit/kunit.py @@ -263,9 +263,8 @@ def add_exec_opts(parser) -> None: default=300, metavar='timeout') parser.add_argument('filter_glob', - help='maximum number of seconds to allow for all tests ' - 'to run. This does not include time taken to build the ' - 'tests.', + help='Filter which KUnit test suites/tests run at ' + 'boot-time, e.g. list* or list*.*del_test', type=str, nargs='?', default='', |