diff options
author | Tom Rini <trini@konsulko.com> | 2019-07-29 17:59:51 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-07-29 17:59:51 -0400 |
commit | de17e1fc03d97d420e9cb59f3a4d0f17c8bdcce5 (patch) | |
tree | 3b2d1e382ee75a3d2141d902395c9f3d5f49904e /tools/binman/elf_test.py | |
parent | 333755ef7b6f824366eed37ae068c20a4f25a123 (diff) | |
parent | 4f4fb85ec0bfe45da11aa23ada565387ee676e80 (diff) |
Merge tag 'dm-pull-29jul19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
binman support for replacing files
Diffstat (limited to 'tools/binman/elf_test.py')
-rw-r--r-- | tools/binman/elf_test.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index e2506377f2..416e43baf0 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -14,6 +14,7 @@ import command import elf import test_util import tools +import tout binman_dir = os.path.dirname(os.path.realpath(sys.argv[0])) @@ -130,14 +131,16 @@ class TestElf(unittest.TestCase): def testDebug(self): """Check that enabling debug in the elf module produced debug output""" - elf.debug = True - entry = FakeEntry(20) - section = FakeSection() - elf_fname = os.path.join(binman_dir, 'test', 'u_boot_binman_syms') - with test_util.capture_sys_output() as (stdout, stderr): - syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) - elf.debug = False - self.assertTrue(len(stdout.getvalue()) > 0) + try: + tout.Init(tout.DEBUG) + entry = FakeEntry(20) + section = FakeSection() + elf_fname = os.path.join(binman_dir, 'test', 'u_boot_binman_syms') + with test_util.capture_sys_output() as (stdout, stderr): + syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) + self.assertTrue(len(stdout.getvalue()) > 0) + finally: + tout.Init(tout.WARNING) def testMakeElf(self): """Test for the MakeElf function""" |