Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8a096d6

Browse files
authored
ci: Print output in case of compile error (#23522)
* Print compile error * Better comment * Update run_tests.py
1 parent e3e3b2b commit 8a096d6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

testing/run_tests.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,14 @@ def SnapshotTest(build_dir, dart_file, kernel_file_output, verbose_dart_snapshot
214214
if verbose_dart_snapshot:
215215
RunCmd(snapshot_command, cwd=buildroot_dir)
216216
else:
217-
subprocess.check_output(snapshot_command, cwd=buildroot_dir)
217+
try:
218+
subprocess.check_output(snapshot_command, cwd=buildroot_dir)
219+
except subprocess.CalledProcessError as error:
220+
# CalledProcessError's string doesn't print the output. Print it before
221+
# the crash for easier inspection.
222+
print('Error occurred from the subprocess, with the output:')
223+
print(error.output)
224+
raise
218225
assert os.path.exists(kernel_file_output)
219226

220227

0 commit comments

Comments
 (0)