binman: Report an error if test files fail to compile
authorSimon Glass <sjg@chromium.org>
Thu, 4 Nov 2021 03:09:15 +0000 (21:09 -0600)
committerSimon Glass <sjg@chromium.org>
Sat, 13 Nov 2021 15:16:39 +0000 (08:16 -0700)
At present any error from the 'make' command is silently swallowed by the
test system. Fix this by showing it when detected.

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

index 7a12801..bcccd78 100644 (file)
@@ -70,8 +70,12 @@ def BuildElfTestFiles(target_dir):
     # correctly. So drop any make flags here.
     if 'MAKEFLAGS' in os.environ:
         del os.environ['MAKEFLAGS']
-    tools.Run('make', '-C', target_dir, '-f',
-              os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir)
+    try:
+        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
+        print(e)
 
 
 class TestElf(unittest.TestCase):