1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-11-01 19:05:51 +01:00

binman: Add a bit of logging in entries when packing

Use the new logging feature to log information about progress with
packing. This is useful to see how binman is figuring things out.

Also update elf.py to use the same feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2019-07-20 12:23:36 -06:00
parent fd07336211
commit 9f297b09c0
6 changed files with 53 additions and 16 deletions

View File

@@ -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"""