]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Read map files as text
authorSimon Glass <sjg@chromium.org>
Sat, 18 May 2019 04:00:51 +0000 (22:00 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 10 Jul 2019 22:52:58 +0000 (16:52 -0600)
These files are text files so should be read as such, so that
string-equality assertions work as expected.

With this binman tests work correctly on Python 2 and Python 3:

PYTHONPATH=/tmp/b/sandbox_spl/scripts/dtc/pylibfdt \
python ./tools/binman/binman -t

Change first line of binman.py to end "python3":

PYTHONPATH=~/cosarm/dtc/pylibfdt:tools/patman \
python3 ./tools/binman/binman -t

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/ftest.py

index d0a8b751a2ce77f4f63d339c3c5fe5483b25e26c..cc57ef3e04ae15824a08ea2595b64779de613aa3 100644 (file)
@@ -1777,7 +1777,7 @@ class TestFunctional(unittest.TestCase):
         # We should not get an inmage, but there should be a map file
         self.assertFalse(os.path.exists(tools.GetOutputFilename('image.bin')))
         self.assertTrue(os.path.exists(map_fname))
-        map_data = tools.ReadFile(map_fname)
+        map_data = tools.ReadFile(map_fname, binary=False)
         self.assertEqual('''ImagePos    Offset      Size  Name
 <none>    00000000  00000007  main-section
 <none>     00000000  00000004  u-boot