aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamilo Celis Guzman <camilo@pexip.com>2020-07-14 15:09:41 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2020-07-30 16:38:07 +0300
commit8da1b29899e795d87f0a4e51adb532119af48727 (patch)
treef32b2acbf1fb267dd90ba4935ed64d1227e8ca94
parent1ce4258c219fe08b6d6eaa6aa944f27d91d054cb (diff)
downloadmeson-8da1b29899e795d87f0a4e51adb532119af48727.zip
meson-8da1b29899e795d87f0a4e51adb532119af48727.tar.gz
meson-8da1b29899e795d87f0a4e51adb532119af48727.tar.bz2
mtest: report failures and overall summary *after* test(s) logs
-rw-r--r--mesonbuild/mtest.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 4aafe62..0d81692 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -794,6 +794,7 @@ class TestHarness:
def __init__(self, options: argparse.Namespace):
self.options = options
self.collected_logs = [] # type: T.List[str]
+ self.collected_failures = [] # type: T.List[str]
self.fail_count = 0
self.expectedfail_count = 0
self.unexpectedpass_count = 0
@@ -908,6 +909,7 @@ class TestHarness:
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
@@ -928,7 +930,11 @@ class TestHarness:
self.junit.log(name, result)
def print_summary(self) -> None:
- msg = textwrap.dedent('''
+ # Prepend a list of failures
+ msg = '' if len(self.collected_failures) < 1 else "\nSummary of Failures:\n\n"
+ msg += '\n'.join(self.collected_failures)
+ msg += textwrap.dedent('''
+
Ok: {:<4}
Expected Fail: {:<4}
Fail: {:<4}
@@ -1128,8 +1134,8 @@ class TestHarness:
break
self.drain_futures(futures)
- self.print_summary()
self.print_collected_logs()
+ self.print_summary()
if self.logfilename:
print('Full log written to {}'.format(self.logfilename))