diff options
author | Tom Rini <trini@konsulko.com> | 2022-02-10 09:02:06 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-02-10 09:19:44 -0500 |
commit | 2ccd2bc8c3580e00c51094c5cc2b3e2ead8d35c3 (patch) | |
tree | 4e7349b8831fee4b342a971025273d3cd042a2f9 /tools/binman/elf_test.py | |
parent | 6662e5e406fdee26ba981dd4af3308f51f254f0a (diff) | |
parent | f3078d4ea707931c2307a623ecf6e4d215b413d5 (diff) |
Merge tag 'dm-pull-8feb22-take3' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
patman snake-case conversion
binman fit improvements
ACPI fixes and making MCFG available to ARM
[trini: Update scripts/pylint.base]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/binman/elf_test.py')
-rw-r--r-- | tools/binman/elf_test.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index f7272584878..47ebfbac4a6 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -27,7 +27,7 @@ class FakeEntry: """ def __init__(self, contents_size): self.contents_size = contents_size - self.data = tools.GetBytes(ord('a'), contents_size) + self.data = tools.get_bytes(ord('a'), contents_size) def GetPath(self): return 'entry_path' @@ -72,7 +72,7 @@ def BuildElfTestFiles(target_dir): if 'MAKEFLAGS' in os.environ: del os.environ['MAKEFLAGS'] try: - tools.Run('make', '-C', target_dir, '-f', + tools.run('make', '-C', target_dir, '-f', os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir) except ValueError as e: # The test system seems to suppress this in a strange way @@ -83,7 +83,7 @@ class TestElf(unittest.TestCase): @classmethod def setUpClass(cls): cls._indir = tempfile.mkdtemp(prefix='elf.') - tools.SetInputDirs(['.']) + tools.set_input_dirs(['.']) BuildElfTestFiles(cls._indir) @classmethod @@ -166,13 +166,13 @@ class TestElf(unittest.TestCase): section = FakeSection(sym_value=None) elf_fname = self.ElfTestFile('u_boot_binman_syms') syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) - self.assertEqual(tools.GetBytes(255, 20) + tools.GetBytes(ord('a'), 4), + self.assertEqual(tools.get_bytes(255, 20) + tools.get_bytes(ord('a'), 4), entry.data) def testDebug(self): """Check that enabling debug in the elf module produced debug output""" try: - tout.Init(tout.DEBUG) + tout.init(tout.DEBUG) entry = FakeEntry(20) section = FakeSection() elf_fname = self.ElfTestFile('u_boot_binman_syms') @@ -180,7 +180,7 @@ class TestElf(unittest.TestCase): syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) self.assertTrue(len(stdout.getvalue()) > 0) finally: - tout.Init(tout.WARNING) + tout.init(tout.WARNING) def testMakeElf(self): """Test for the MakeElf function""" @@ -193,9 +193,9 @@ class TestElf(unittest.TestCase): # Make an Elf file and then convert it to a fkat binary file. This # should produce the original data. elf.MakeElf(elf_fname, expected_text, expected_data) - objcopy, args = tools.GetTargetCompileTool('objcopy') + objcopy, args = tools.get_target_compile_tool('objcopy') args += ['-O', 'binary', elf_fname, bin_fname] - stdout = command.Output(objcopy, *args) + stdout = command.output(objcopy, *args) with open(bin_fname, 'rb') as fd: data = fd.read() self.assertEqual(expected_text + expected_data, data) @@ -210,7 +210,7 @@ class TestElf(unittest.TestCase): expected_data = b'wxyz' elf_fname = os.path.join(outdir, 'elf') elf.MakeElf(elf_fname, expected_text, expected_data) - data = tools.ReadFile(elf_fname) + data = tools.read_file(elf_fname) load = 0xfef20000 entry = load + 2 @@ -231,7 +231,7 @@ class TestElf(unittest.TestCase): offset = elf.GetSymbolFileOffset(fname, ['embed_start', 'embed_end']) start = offset['embed_start'].offset end = offset['embed_end'].offset - data = tools.ReadFile(fname) + data = tools.read_file(fname) embed_data = data[start:end] expect = struct.pack('<III', 0x1234, 0x5678, 0) self.assertEqual(expect, embed_data) |