Skip to content

Commit 71f6939

Browse files
authored
Merge pull request #114 from ax3l/topic-printFailedBuildTest
CI: Print error reports when tests fail
2 parents 395cf1e + 97b87e3 commit 71f6939

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

regtest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,12 @@ def test_suite(argv):
563563
if not test.compile_successful:
564564
error_msg = "ERROR: compilation failed"
565565
report.report_single_test(suite, test, test_list, failure_msg=error_msg)
566+
567+
# Print compilation error message (useful for CI tests)
568+
if suite.verbose > 0:
569+
with open(f"{output_dir}/{test.name}.make.out") as f:
570+
print(f.read())
571+
566572
continue
567573

568574
if test.compileTest:
@@ -1079,6 +1085,11 @@ def test_suite(argv):
10791085
analysis_successful = False
10801086
suite.log.warn("analysis failed...")
10811087

1088+
# Print analysis error message (useful for CI tests)
1089+
if suite.verbose > 0:
1090+
with open(outfile) as f:
1091+
print(f.read())
1092+
10821093
test.analysis_successful = analysis_successful
10831094

10841095
else:

suite.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,16 @@ def run_test(self, test, base_command):
967967
test.run_command = test_run_command
968968
test.return_code = ierr
969969

970+
# Print compilation error message (useful for CI tests)
971+
if test.return_code != 0 and self.verbose > 0:
972+
self.log.warn("Test stdout:")
973+
with open(f"{outfile}") as f:
974+
print(f.read())
975+
if os.path.isfile(errfile):
976+
self.log.warn("Test stderr:")
977+
with open(f"{errfile}") as f:
978+
print(f.read())
979+
970980
def copy_backtrace(self, test):
971981
"""
972982
if any backtrace files were output (because the run crashed), find them

0 commit comments

Comments
 (0)