The kmstest.py runner is a convenient way to run all the tests in the current directory, in addition to running specific tests manually. It is also useful to run a subset of the tests. Add support for this by specifying them as command line arguments to kmstest.py. Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> --- tests/kmstest.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/kmstest.py b/tests/kmstest.py index 4bd4e0ad27a6..a86d689347d9 100755 --- a/tests/kmstest.py +++ b/tests/kmstest.py @@ -549,14 +549,23 @@ class KMSTest(object): if __name__ == '__main__': + import argparse import importlib import inspect import os + import sys - files = [] - for path in os.scandir(): - if path.is_file() and path.name.startswith('kms-test-') and path.name.endswith('.py'): - files.append(path.name) + parser = argparse.ArgumentParser() + parser.add_argument('test', type=str, nargs='*', help='Tests files') + args = parser.parse_args(sys.argv[1:]) + + if args.test: + files = args.test + else: + files = [] + for path in os.scandir(): + if path.is_file() and path.name.startswith('kms-test-') and path.name.endswith('.py'): + files.append(path.name) files.sort() for file in files: base-commit: 2264236eefd15450320c0cdb34fa07ac0881f713 -- Regards, Laurent Pinchart