From ba71fde18652ca156a35cd576dd9981202088424 Mon Sep 17 00:00:00 2001 From: Camilo Celis Guzman Date: Sat, 10 Oct 2020 23:12:49 +0200 Subject: mtest: collect failures regardless of colorized console --- mesonbuild/mtest.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index ee1d412..caf4039 100644 --- a/mesonbuild/mtest.py +++ b/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() -- cgit v1.1