]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test/py: Handle u-boot-test-getrole failure
authorSimon Glass <sjg@chromium.org>
Sat, 14 Dec 2024 18:20:21 +0000 (11:20 -0700)
committerTom Rini <trini@konsulko.com>
Sat, 25 Jan 2025 22:27:24 +0000 (16:27 -0600)
This script can fail if there is no toolchain available for the board.
At present this is not handled very nicely, in that only the error
output is reported. It is much more useful to see everything, so
combine stdout and stderr and report them both.

Signed-off-by: Simon Glass <sjg@chromium.org>
test/py/conftest.py

index 44b22761a8b209f1c1c63a67de8b51e299e726c7..3bd333bfd248a6ad9d3b5283f90ee4a5b23df08d 100644 (file)
@@ -165,10 +165,11 @@ def get_details(config):
        # Make sure the script sees that it is being run from pytest
         env['U_BOOT_SOURCE_DIR'] = source_dir
 
-        proc = subprocess.run(cmd, capture_output=True, encoding='utf-8',
+        proc = subprocess.run(cmd, stdout=subprocess.PIPE,
+                              stderr=subprocess.STDOUT, encoding='utf-8',
                               env=env)
         if proc.returncode:
-            raise ValueError(proc.stderr)
+            raise ValueError(f"Error {proc.returncode} running {cmd}: '{proc.stderr} '{proc.stdout}'")
         # For debugging
         # print('conftest: lab:', proc.stdout)
         vals = {}