LKML Archive on
help / color / mirror / Atom feed
From: Brendan Higgins <>
To: David Gow <>
Cc: Shuah Khan <>,
	Andy Shevchenko <>,
	Daniel Latypov <>, Rae Moar <>,,,
Subject: Re: [PATCH v2] kunit: Print test statistics on failure
Date: Thu, 5 Aug 2021 11:14:47 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, Aug 3, 2021 at 10:08 PM David Gow <> wrote:
> When a number of tests fail, it can be useful to get higher-level
> statistics of how many tests are failing (or how many parameters are
> failing in parameterised tests), and in what cases or suites. This is
> already done by some non-KUnit tests, so add support for automatically
> generating these for KUnit tests.
> This change adds a 'kunit.stats_enabled' switch which has three values:
> - 0: No stats are printed (current behaviour)
> - 1: Stats are printed only for tests/suites with more than one
>      subtest (new default)
> - 2: Always print test statistics
> For parameterised tests, the summary line looks as follows:
> "    # inode_test_xtimestamp_decoding: pass:16 fail:0 skip:0 total:16"
> For test suites, there are two lines looking like this:
> "# ext4_inode_test: pass:1 fail:0 skip:0 total:1"
> "# Totals: pass:16 fail:0 skip:0 total:16"
> The first line gives the number of direct subtests, the second "Totals"
> line is the accumulated sum of all tests and test parameters.
> This format is based on the one used by kselftest[1].
> [1]:
> Signed-off-by: David Gow <>

This looks great, David!

My only suggestion, can you maybe provide a sample of the TAP output
with your change running on the thread? I think it looks great, but I
imagine that it has the potential of being more interesting to people
other than you, Daniel, and myself rather than the actual code change.
(To be clear, I think the summary and the code both look good, IMO.)

Reviewed-by: Brendan Higgins <>


  parent reply	other threads:[~2021-08-05 18:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04  5:08 David Gow
2021-08-04  7:42 ` Andy Shevchenko
2021-08-04 18:39 ` Daniel Latypov
2021-08-05 18:14 ` Brendan Higgins [this message]
2021-08-13  5:41   ` David Gow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v2] kunit: Print test statistics on failure' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).