Skip to content

Commit

Permalink
Merge pull request #114 from ax3l/topic-printFailedBuildTest
Browse files Browse the repository at this point in the history
CI: Print error reports when tests fail
  • Loading branch information
ax3l authored Jan 15, 2022
2 parents 395cf1e + 97b87e3 commit 71f6939
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions regtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,12 @@ def test_suite(argv):
if not test.compile_successful:
error_msg = "ERROR: compilation failed"
report.report_single_test(suite, test, test_list, failure_msg=error_msg)

# Print compilation error message (useful for CI tests)
if suite.verbose > 0:
with open(f"{output_dir}/{test.name}.make.out") as f:
print(f.read())

continue

if test.compileTest:
Expand Down Expand Up @@ -1079,6 +1085,11 @@ def test_suite(argv):
analysis_successful = False
suite.log.warn("analysis failed...")

# Print analysis error message (useful for CI tests)
if suite.verbose > 0:
with open(outfile) as f:
print(f.read())

test.analysis_successful = analysis_successful

else:
Expand Down
10 changes: 10 additions & 0 deletions suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,16 @@ def run_test(self, test, base_command):
test.run_command = test_run_command
test.return_code = ierr

# Print compilation error message (useful for CI tests)
if test.return_code != 0 and self.verbose > 0:
self.log.warn("Test stdout:")
with open(f"{outfile}") as f:
print(f.read())
if os.path.isfile(errfile):
self.log.warn("Test stderr:")
with open(f"{errfile}") as f:
print(f.read())

def copy_backtrace(self, test):
"""
if any backtrace files were output (because the run crashed), find them
Expand Down

0 comments on commit 71f6939

Please sign in to comment.