lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGS_qxqR_WQ4mn20_bMnWi-F969B5BxrvXr8QiQzufGAs+bHnA@mail.gmail.com>
Date:   Fri, 8 Apr 2022 16:54:26 -0500
From:   Daniel Latypov <dlatypov@...gle.com>
To:     David Gow <davidgow@...gle.com>
Cc:     Brendan Higgins <brendanhiggins@...gle.com>,
        Shuah Khan <skhan@...uxfoundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        KUnit Development <kunit-dev@...glegroups.com>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH] kunit: tool: Print a total count of tests.

On Fri, Apr 8, 2022 at 2:04 PM Daniel Latypov <dlatypov@...gle.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/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ