buildman: dtoc: Suppress unwanted output from test

There are a few test cases which print output. Suppress this so that tests
can run silently in the normal case.

Signed-off-by: Simon Glass <sjg@chromium.org>
lime2-spi
Simon Glass 6 years ago
parent 86af511d89
commit 4b4bc06ef4
  1. 4
      tools/buildman/test.py
  2. 6
      tools/dtoc/test_dtoc.py

@ -20,6 +20,7 @@ import control
import command import command
import commit import commit
import terminal import terminal
import test_util
import toolchain import toolchain
use_network = True use_network = True
@ -422,7 +423,8 @@ class TestBuild(unittest.TestCase):
def testToolchainDownload(self): def testToolchainDownload(self):
"""Test that we can download toolchains""" """Test that we can download toolchains"""
if use_network: if use_network:
url = self.toolchains.LocateArchUrl('arm') with test_util.capture_sys_output() as (stdout, stderr):
url = self.toolchains.LocateArchUrl('arm')
self.assertRegexpMatches(url, 'https://www.kernel.org/pub/tools/' self.assertRegexpMatches(url, 'https://www.kernel.org/pub/tools/'
'crosstool/files/bin/x86_64/.*/' 'crosstool/files/bin/x86_64/.*/'
'x86_64-gcc-.*-nolibc_arm-.*linux-gnueabi.tar.xz') 'x86_64-gcc-.*-nolibc_arm-.*linux-gnueabi.tar.xz')

@ -385,7 +385,8 @@ U_BOOT_DEVICE(phandle_source2) = {
def test_phandle_bad(self): def test_phandle_bad(self):
"""Test a node containing an invalid phandle fails""" """Test a node containing an invalid phandle fails"""
dtb_file = get_dtb_file('dtoc_test_phandle_bad.dts') dtb_file = get_dtb_file('dtoc_test_phandle_bad.dts',
capture_stderr=True)
output = tools.GetOutputFilename('output') output = tools.GetOutputFilename('output')
with self.assertRaises(ValueError) as e: with self.assertRaises(ValueError) as e:
dtb_platdata.run_steps(['struct'], dtb_file, False, output) dtb_platdata.run_steps(['struct'], dtb_file, False, output)
@ -394,7 +395,8 @@ U_BOOT_DEVICE(phandle_source2) = {
def test_phandle_bad2(self): def test_phandle_bad2(self):
"""Test a phandle target missing its #*-cells property""" """Test a phandle target missing its #*-cells property"""
dtb_file = get_dtb_file('dtoc_test_phandle_bad2.dts') dtb_file = get_dtb_file('dtoc_test_phandle_bad2.dts',
capture_stderr=True)
output = tools.GetOutputFilename('output') output = tools.GetOutputFilename('output')
with self.assertRaises(ValueError) as e: with self.assertRaises(ValueError) as e:
dtb_platdata.run_steps(['struct'], dtb_file, False, output) dtb_platdata.run_steps(['struct'], dtb_file, False, output)

Loading…
Cancel
Save