diff options
author | Simon Glass <sjg@chromium.org> | 2025-04-29 07:22:06 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2025-05-27 10:07:41 +0100 |
commit | a61635d2af81d00b02155eb5decc03eb92f94413 (patch) | |
tree | 8f1ff2e6a3bfcc93732153c1b660bb178814ed78 /tools/u_boot_pylib/test_util.py | |
parent | 9dee86cf533271deddd7f8ab077d98e4a1d3cb78 (diff) |
tools: Plumb in capture control
Add control of capturing output into u_boot_pylib and the tools which
use it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/u_boot_pylib/test_util.py')
-rw-r--r-- | tools/u_boot_pylib/test_util.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/u_boot_pylib/test_util.py b/tools/u_boot_pylib/test_util.py index fc441a78dc1..d258a1935c9 100644 --- a/tools/u_boot_pylib/test_util.py +++ b/tools/u_boot_pylib/test_util.py @@ -12,6 +12,7 @@ import sys import unittest from u_boot_pylib import command +from u_boot_pylib import terminal use_concurrent = True try: @@ -155,8 +156,8 @@ class FullTextTestResult(unittest.TextTestResult): super().addSkip(test, reason) -def run_test_suites(toolname, debug, verbosity, test_preserve_dirs, processes, - test_name, toolpath, class_and_module_list): +def run_test_suites(toolname, debug, verbosity, no_capture, test_preserve_dirs, + processes, test_name, toolpath, class_and_module_list): """Run a series of test suites and collect the results Args: @@ -179,6 +180,9 @@ def run_test_suites(toolname, debug, verbosity, test_preserve_dirs, processes, sys.argv.append('-D') if verbosity: sys.argv.append('-v%d' % verbosity) + if no_capture: + sys.argv.append('-N') + terminal.USE_CAPTURE = False if toolpath: for path in toolpath: sys.argv += ['--toolpath', path] @@ -207,7 +211,7 @@ def run_test_suites(toolname, debug, verbosity, test_preserve_dirs, processes, setup_test_args = getattr(module, 'setup_test_args') setup_test_args(preserve_indir=test_preserve_dirs, preserve_outdirs=test_preserve_dirs and test_name is not None, - toolpath=toolpath, verbosity=verbosity) + toolpath=toolpath, verbosity=verbosity, no_capture=no_capture) if test_name: # Since Python v3.5 If an ImportError or AttributeError occurs # while traversing a name then a synthetic test that raises that |