aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemmo Nieminen <hemmo.nieminen@iki.fi>2022-02-01 00:00:00 +0200
committerHemmo Nieminen <hemmo.nieminen@iki.fi>2022-03-23 00:00:00 +0200
commitdf6cd8da500b7cb249e6aef90f6fd62d2dddaff8 (patch)
tree60dd216c3952a71091f62c15731cb7f2939288b2
parent218cf9d26f1cdc688d3ad55ae3809cc22987c828 (diff)
downloadmeson-df6cd8da500b7cb249e6aef90f6fd62d2dddaff8.zip
meson-df6cd8da500b7cb249e6aef90f6fd62d2dddaff8.tar.gz
meson-df6cd8da500b7cb249e6aef90f6fd62d2dddaff8.tar.bz2
mtest: make ConsoleLogger's detail property a function
As fetching the returned data is non-trivial (we e.g. iterate over all subtest results) it is best not to hide that fact from the caller of the property / function.
-rw-r--r--mesonbuild/mtest.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 88db512..74b68ac 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -555,9 +555,9 @@ class ConsoleLogger(TestLogger):
timeout=self.progress_test.timeout,
durlen=harness.duration_max_len)
right += 's'
- detail = self.progress_test.detail
- if detail:
- right += ' ' + detail
+ details = self.progress_test.get_details()
+ if details:
+ right += ' ' + details
line = harness.format(self.progress_test, colorize=True,
max_left_width=self.max_left_width,
@@ -905,8 +905,7 @@ class TestRun:
def direct_stdout(self) -> bool:
return self.verbose and not self.is_parallel and not self.needs_parsing
- @property
- def detail(self) -> str:
+ def get_details(self) -> str:
if self.res is TestResult.PENDING:
return ''
if self.returncode:
@@ -1646,9 +1645,9 @@ class TestHarness:
res=result.res.get_text(colorize),
dur=result.duration,
durlen=self.duration_max_len + 3)
- detail = result.detail
- if detail:
- right += ' ' + detail
+ details = result.get_details()
+ if details:
+ right += ' ' + details
return prefix + left + middle + right
def summary(self) -> str: