From c8a030439b01dc92f6e1b1de467b5d8922a973bb Mon Sep 17 00:00:00 2001 From: toofar Date: Sun, 16 Jul 2023 22:33:41 +1200 Subject: build_release: print output on nonzero exit code too Also print output on --debug runs too --- scripts/dev/build_release.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 65eef720c..c7cebbe3a 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -121,7 +121,7 @@ def _smoke_test_run( 'about:blank', ':cmd-later 500 quit', ] - return subprocess.run(argv, check=True, capture_output=True) + return subprocess.run(argv, capture_output=True) def smoke_test(executable: pathlib.Path, debug: bool, qt5: bool) -> None: @@ -182,15 +182,14 @@ def smoke_test(executable: pathlib.Path, debug: bool, qt5: bool) -> None: ]) proc = _smoke_test_run(executable) - if debug: - print("Skipping output check for debug build") - return stdout = '\n'.join(_filter_whitelisted(proc.stdout, stdout_whitelist)) stderr = '\n'.join(_filter_whitelisted(proc.stderr, stderr_whitelist)) - if stdout or stderr: - print("Unexpected output, running with --debug") + if stdout or stderr or proc.returncode > 0: + print( + f"Unexpected output, running with --debug (returncode={proc.returncode})" + ) proc = _smoke_test_run(executable, '--debug') debug_stdout = proc.stdout.decode('utf-8') debug_stderr = proc.stderr.decode('utf-8') @@ -232,6 +231,9 @@ def smoke_test(executable: pathlib.Path, debug: bool, qt5: bool) -> None: "", ] + if debug: + print("Skipping output check for debug build") + return raise Exception("\n".join(lines)) # pylint: disable=broad-exception-raised -- cgit v1.2.3-54-g00ecf