summaryrefslogtreecommitdiff
path: root/tools/buildman/func_test.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2025-04-29 07:21:59 -0600
committerSimon Glass <sjg@chromium.org>2025-05-27 10:07:41 +0100
commitae3695f691c6325f1a504ee3df7f22d75c7a0c96 (patch)
treef18e01121a9e05a60835462be85662a3d85cc7d9 /tools/buildman/func_test.py
parent6330f94a35142c135c96f5af952087ef3d9c3177 (diff)
patman: Move capture_sys_output() into terminal and rename
This function is sometimes useful outside tests. Also it can affect how terminal output is done, e.g. whether ANSI characters should be emitted or not. Move it out of the test_util package and into terminal. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman/func_test.py')
-rw-r--r--tools/buildman/func_test.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index d70849b47ab..51c6855420e 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -670,7 +670,7 @@ Some images are invalid'''
def testThreadExceptions(self):
"""Test that exceptions in threads are reported"""
- with test_util.capture_sys_output() as (stdout, stderr):
+ with terminal.capture() as (stdout, stderr):
self.assertEqual(102, self._RunControl('-o', self._output_dir,
test_thread_exceptions=True))
self.assertIn(
@@ -808,7 +808,7 @@ Some images are invalid'''
# CONFIG_LOCALVERSION_AUTO is not set
''', cfg_data)
- with test_util.capture_sys_output() as (stdout, stderr):
+ with terminal.capture() as (stdout, stderr):
lines, cfg_data = self.check_command('-r', '-a', 'LOCALVERSION')
self.assertIn(b'SOURCE_DATE_EPOCH=0', lines[0])
@@ -1032,14 +1032,14 @@ endif
outfile = os.path.join(self._output_dir, 'test-boards.cfg')
if os.path.exists(outfile):
os.remove(outfile)
- with test_util.capture_sys_output() as (stdout, stderr):
+ with terminal.capture() as (stdout, stderr):
result = self._RunControl('-R', outfile, brds=None,
get_builder=False)
self.assertTrue(os.path.exists(outfile))
def test_print_prefix(self):
"""Test that we can print the toolchain prefix"""
- with test_util.capture_sys_output() as (stdout, stderr):
+ with terminal.capture() as (stdout, stderr):
result = self._RunControl('-A', 'board0')
self.assertEqual('arm-\n', stdout.getvalue())
self.assertEqual('', stderr.getvalue())
@@ -1083,7 +1083,7 @@ endif
def test_print_arch(self):
"""Test that we can print the board architecture"""
- with test_util.capture_sys_output() as (stdout, stderr):
+ with terminal.capture() as (stdout, stderr):
result = self._RunControl('--print-arch', 'board0')
self.assertEqual('arm\n', stdout.getvalue())
self.assertEqual('', stderr.getvalue())