diff options
| author | Jakub Kicinski <[email protected]> | 2024-04-20 02:52:35 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-04-23 17:13:56 +0000 |
| commit | 01b431641c33d488ecc6cd6d9e01f7f073bfa54f (patch) | |
| tree | 7d0449e458e4c69b484d8dba9f689c639cb0b85e /tools/testing/selftests/drivers/net/ping.py | |
| parent | selftests: drv-net: add a trivial ping test (diff) | |
| download | kernel-01b431641c33d488ecc6cd6d9e01f7f073bfa54f.tar.gz kernel-01b431641c33d488ecc6cd6d9e01f7f073bfa54f.zip | |
selftests: net: support matching cases by name prefix
While writing tests with a lot more cases I got tired of having
to jump back and forth to add the name of the test to the ksft_run()
list. Most unittest frameworks do some name matching, e.g. assume
that functions with names starting with test_ are test cases.
Support similar flow in ksft_run(). Let the author list the desired
prefixes. globals() need to be passed explicitly, IDK how to work
around that.
Reviewed-by: Willem de Bruijn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/drivers/net/ping.py')
| -rwxr-xr-x | tools/testing/selftests/drivers/net/ping.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/testing/selftests/drivers/net/ping.py b/tools/testing/selftests/drivers/net/ping.py index e75908d7c558..9f65a0764aab 100755 --- a/tools/testing/selftests/drivers/net/ping.py +++ b/tools/testing/selftests/drivers/net/ping.py @@ -18,8 +18,7 @@ def test_v6(cfg) -> None: def main() -> None: with NetDrvEpEnv(__file__) as cfg: - ksft_run([test_v4, test_v6], - args=(cfg, )) + ksft_run(globs=globals(), case_pfx={"test_"}, args=(cfg, )) ksft_exit() |
