diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-01-06 16:31:19 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-01-07 19:20:40 +0100 |
commit | 4371756182e9adbd80dd00c10fdce17bbec8ffda (patch) | |
tree | 2a5fbe86de5e5029d93d11f5a254838dead49b29 /mesonbuild/mtest.py | |
parent | 72e96a470a13928526a292cc8066e230df612d19 (diff) | |
download | meson-4371756182e9adbd80dd00c10fdce17bbec8ffda.zip meson-4371756182e9adbd80dd00c10fdce17bbec8ffda.tar.gz meson-4371756182e9adbd80dd00c10fdce17bbec8ffda.tar.bz2 |
mtest: align decimal point of test durations
Diffstat (limited to 'mesonbuild/mtest.py')
-rw-r--r-- | mesonbuild/mtest.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index 0b87c03..c8dc023 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -1055,6 +1055,10 @@ class SingleTestRunner: def visible_name(self) -> str: return self.runobj.name + @property + def timeout(self) -> T.Optional[int]: + return self.runobj.timeout + async def run(self) -> TestRun: cmd = self._get_cmd() self.runobj.start() @@ -1314,9 +1318,10 @@ class TestHarness: middle = result.name + (' ' * max(1, extra_name_width)) if right is None: - right = '{res} {dur:.2f}s'.format( + right = '{res} {dur:{durlen}.2f}s'.format( res=result.res.get_text(colorize), - dur=result.duration) + dur=result.duration, + durlen=self.duration_max_len + 3) detail = result.detail if detail: right += ' (' + detail + ')' @@ -1360,6 +1365,8 @@ class TestHarness: os.chdir(self.options.wd) self.build_data = build.load(os.getcwd()) runners = [self.get_test_runner(test) for test in tests] + self.duration_max_len = max([len(str(int(runner.timeout or 99))) + for runner in runners]) self.run_tests(runners) finally: os.chdir(startdir) |