lkml.org 
[lkml]   [2022]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] kunit: tool: Print a total count of tests.
On Fri, Apr 8, 2022 at 2:04 PM Daniel Latypov <dlatypov@google.com> wrote:
<snip>

> E.g. I get this output
> Ran 173 tests: passed: 137, skipped: 36
>
> with a new combined patch of
>
> diff --git a/tools/testing/kunit/kunit_parser.py
> b/tools/testing/kunit/kunit_parser.py
> index 807ed2bd6832..de1c0b7e14ed 100644
> --- a/tools/testing/kunit/kunit_parser.py
> +++ b/tools/testing/kunit/kunit_parser.py
> @@ -94,11 +94,11 @@ class TestCounts:
> def __str__(self) -> str:
> """Returns the string representation of a TestCounts object.
> """
> - return ('Passed: ' + str(self.passed) +
> - ', Failed: ' + str(self.failed) +
> - ', Crashed: ' + str(self.crashed) +
> - ', Skipped: ' + str(self.skipped) +
> - ', Errors: ' + str(self.errors))
> + statuses = [('passed', self.passed), ('failed', self.failed),
> + ('crashed', self.crashed), ('skipped', self.skipped),
> + ('errors', self.errors)]
> + return f'Ran {self.total()} tests: ' + \
> + ', '.join(f'{s}: {n}' for s, n in statuses if n > 0)
>
> def total(self) -> int:
> """Returns the total number of test cases within a test
>

Sent this patch out as a v2,
https://lore.kernel.org/linux-kselftest/20220408215105.2332902-1-dlatypov@google.com/

\
 
 \ /
  Last update: 2022-04-08 23:55    [W:0.309 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site