aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/elf_test.py
diff options
context:
space:
mode:
authorSimon Glass2019-07-20 12:23:36 -0600
committerSimon Glass2019-07-29 09:38:05 -0600
commit9f297b09c06f2212cb59dac5950ae61de5fe3a9f (patch)
tree2f63132f9076b2a41511bd0e72fafcf1fe5d5680 /tools/binman/elf_test.py
parentfd07336211c3b3088dce20b1c22a99e6303c68c2 (diff)
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>
Diffstat (limited to 'tools/binman/elf_test.py')
-rw-r--r--tools/binman/elf_test.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py
index e2506377f26..416e43baf0e 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"""