summaryrefslogtreecommitdiff
path: root/tools/u_boot_pylib/test_util.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-10-18 22:32:45 -0600
committerTom Rini <trini@konsulko.com>2024-10-18 22:32:45 -0600
commit7036abbd5c3934059b020d5fd5bcb8b3bf3c788c (patch)
tree0fb8fd19b51862cf5742ec68ef889e4ad441dde7 /tools/u_boot_pylib/test_util.py
parentf83e36fd83c74b4e28a45a9d56abc4ad9b7848b9 (diff)
parent44917d586657eeae0401bc29af80011a264002e7 (diff)
Merge tag 'dm-pull-17oct24-take2' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
A few new x86 commands and minor improvements expo improvements binman support for signing FIT images
Diffstat (limited to 'tools/u_boot_pylib/test_util.py')
-rw-r--r--tools/u_boot_pylib/test_util.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/u_boot_pylib/test_util.py b/tools/u_boot_pylib/test_util.py
index 857ce58c98c..dd671965263 100644
--- a/tools/u_boot_pylib/test_util.py
+++ b/tools/u_boot_pylib/test_util.py
@@ -23,8 +23,9 @@ except:
use_concurrent = False
-def run_test_coverage(prog, filter_fname, exclude_list, build_dir, required=None,
- extra_args=None, single_thread='-P1'):
+def run_test_coverage(prog, filter_fname, exclude_list, build_dir,
+ required=None, extra_args=None, single_thread='-P1',
+ args=None):
"""Run tests and check that we get 100% coverage
Args:
@@ -42,6 +43,7 @@ def run_test_coverage(prog, filter_fname, exclude_list, build_dir, required=None
single_thread (str): Argument string to make the tests run
single-threaded. This is necessary to get proper coverage results.
The default is '-P0'
+ args (list of str): List of tests to run, or None to run all
Raises:
ValueError if the code coverage is not 100%
@@ -66,9 +68,10 @@ def run_test_coverage(prog, filter_fname, exclude_list, build_dir, required=None
'coverage')
cmd = ('%s%s run '
- '--omit "%s" %s %s %s %s' % (prefix, covtool, ','.join(glob_list),
- prog, extra_args or '', test_cmd,
- single_thread or '-P1'))
+ '--omit "%s" %s %s %s %s %s' % (prefix, covtool, ','.join(glob_list),
+ prog, extra_args or '', test_cmd,
+ single_thread or '-P1',
+ ' '.join(args) if args else ''))
os.system(cmd)
stdout = command.output(covtool, 'report')
lines = stdout.splitlines()