提交 c2497643 编写于 作者: D Daniel Latypov 提交者: Shuah Khan

kunit: tool: update test counts summary line format

Before:
> Testing complete. Passed: 137, Failed: 0, Crashed: 0, Skipped: 36, Errors: 0

After:
> Testing complete. Ran 173 tests: passed: 137, skipped: 36

Even with our current set of statuses, the output is a bit verbose.
It could get worse in the future if we add more (e.g. timeout, kasan).
Let's only print the relevant ones.

I had previously been sympathetic to the argument that always
printing out all the statuses would make it easier to parse results.
But now we have commit acd8e840 ("kunit: Print test statistics on
failure"), there are test counts printed out in the raw output.
We don't currently print out an overall total across all suites, but it
would be easy to add, if we see a need for that.
Signed-off-by: NDaniel Latypov <dlatypov@google.com>
Co-developed-by: NDavid Gow <davidgow@google.com>
Signed-off-by: NDavid Gow <davidgow@google.com>
Reviewed-by: NBrendan Higgins <brendanhiggins@google.com>
Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
上级 a02353f4
...@@ -94,11 +94,11 @@ class TestCounts: ...@@ -94,11 +94,11 @@ class TestCounts:
def __str__(self) -> str: def __str__(self) -> str:
"""Returns the string representation of a TestCounts object. """Returns the string representation of a TestCounts object.
""" """
return ('Passed: ' + str(self.passed) + statuses = [('passed', self.passed), ('failed', self.failed),
', Failed: ' + str(self.failed) + ('crashed', self.crashed), ('skipped', self.skipped),
', Crashed: ' + str(self.crashed) + ('errors', self.errors)]
', Skipped: ' + str(self.skipped) + return f'Ran {self.total()} tests: ' + \
', Errors: ' + str(self.errors)) ', '.join(f'{s}: {n}' for s, n in statuses if n > 0)
def total(self) -> int: def total(self) -> int:
"""Returns the total number of test cases within a test """Returns the total number of test cases within a test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册