aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mtest.py
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-02-21 16:58:19 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2019-03-02 09:07:54 +0100
commitd830945224cf6d109189da03e924d2dffc6214cd (patch)
treedba771dab0957b9fba3983caff308f9778bd9904 /mesonbuild/mtest.py
parent1264f03637b3a0b908913e8d4b064d3a2925a4ef (diff)
downloadmeson-d830945224cf6d109189da03e924d2dffc6214cd.zip
meson-d830945224cf6d109189da03e924d2dffc6214cd.tar.gz
meson-d830945224cf6d109189da03e924d2dffc6214cd.tar.bz2
mtest: do not use return code to look for failed tests
--print-errorlogs is using the test's return code to look for failed tests, instead of just looking at the TestResult. Simplify the code and make it work for TAP too.
Diffstat (limited to 'mesonbuild/mtest.py')
-rw-r--r--mesonbuild/mtest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 74ddd65..57b4a12 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -496,9 +496,10 @@ class TestHarness:
(num, name, padding1, result.res.value, padding2, result.duration,
status)
ok_statuses = (TestResult.OK, TestResult.EXPECTEDFAIL)
+ bad_statuses = (TestResult.FAIL, TestResult.TIMEOUT, TestResult.UNEXPECTEDPASS)
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 (TestResult.FAIL, TestResult.TIMEOUT, TestResult.UNEXPECTEDPASS):
+ if result.res in bad_statuses:
decorator = mlog.red
elif result.res is TestResult.SKIP:
decorator = mlog.yellow
@@ -508,8 +509,7 @@ class TestHarness:
else:
print(result_str)
result_str += "\n\n" + result.get_log()
- if (result.returncode != GNU_SKIP_RETURNCODE) \
- and (result.returncode != 0) != result.should_fail:
+ if result.res in bad_statuses:
if self.options.print_errorlogs:
self.collected_logs.append(result_str)
if self.logfile: