mtest: collect failures regardless of colorized console

pull/7837/head
Camilo Celis Guzman 4 years ago committed by Jussi Pakkanen
parent 96c31d9dbc
commit ba71fde186
  1. 20
      mesonbuild/mtest.py

@ -917,15 +917,17 @@ class TestHarness:
if result.res is TestResult.FAIL:
result_str += ' ' + returncode_to_status(result.returncode)
if not self.options.quiet or result.res not in ok_statuses:
if result.res not in ok_statuses and mlog.colorize_console():
if result.res in bad_statuses:
self.collected_failures.append(result_str)
decorator = mlog.red
elif result.res is TestResult.SKIP:
decorator = mlog.yellow
else:
sys.exit('Unreachable code was ... well ... reached.')
print(decorator(result_str).get_text(True))
if result.res not in ok_statuses:
self.collected_failures.append(result_str)
if mlog.colorize_console():
if result.res in bad_statuses:
self.collected_failures.append(result_str)
decorator = mlog.red
elif result.res is TestResult.SKIP:
decorator = mlog.yellow
else:
sys.exit('Unreachable code was ... well ... reached.')
print(decorator(result_str).get_text(True))
else:
print(result_str)
result_str += "\n\n" + result.get_log()

Loading…
Cancel
Save