linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "André Almeida" <andrealmeid@collabora.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-kernel@vger.kernel.org,
	Brendan Higgins <brendanhiggins@google.com>,
	linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
	Shuah Khan <shuah@kernel.org>,
	~lkcamp/patches@lists.sr.ht, nfraprado@collabora.com,
	leandro.ribeiro@collabora.com,
	Vitor Massaru Iha <vitor@massaru.org>,
	lucmaga@gmail.com, David Gow <davidgow@google.com>,
	Daniel Latypov <dlatypov@google.com>,
	tales.aparecida@gmail.com
Subject: Re: [PATCH v3 0/1] lib: Convert UUID runtime test to KUnit
Date: Fri, 11 Jun 2021 07:48:26 -0300	[thread overview]
Message-ID: <7ad34395-2b62-58fb-8a63-7b4899460290@collabora.com> (raw)
In-Reply-To: <YMMzDUVOlJcw63lf@smile.fi.intel.com>

Hi Andy,

Às 06:55 de 11/06/21, Andy Shevchenko escreveu:
> On Thu, Jun 10, 2021 at 01:39:58PM -0300, André Almeida wrote:
>> Hi,
>>
>> This patch converts existing UUID runtime test to use KUnit framework.
>>
>> Below, there's a comparison between the old output format and the new
>> one. Keep in mind that even if KUnit seems very verbose, this is the
>> corner case where _every_ test has failed.
> 
> Btw, do we have test coverage statistics?
> 
> I mean since we reduced 18 test cases to 12, do we still have the same / better
> test coverage?
> 
I don't think we have automated statistics, but I can assure you that
the coverage it's exactly the same. We are testing two correlated
functions with the same input, in a single test case, instead of having
a single case for each one, so that's why the number of cases is reduced.

For example, instead of:

	total_tests++;
	if (guid_parse(data->uuid, &le))


	total_tests++;
	if (!guid_equal(&data->le, &le))

We now have:

	KUNIT_ASSERT_EQ(guid_parse(data->guid, &le), 0)
	KUNIT_EXPECT_TRUE(guid_equal(&data->le, &le))

That will count as a single test.

      reply	other threads:[~2021-06-11 10:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 16:39 [PATCH v3 0/1] lib: Convert UUID runtime test to KUnit André Almeida
2021-06-10 16:39 ` [PATCH v3 1/1] " André Almeida
2021-06-14  6:42   ` Christoph Hellwig
2021-06-14 16:55     ` Daniel Latypov
2021-06-14 21:08       ` André Almeida
2021-06-11  9:55 ` [PATCH v3 0/1] " Andy Shevchenko
2021-06-11 10:48   ` André Almeida [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=7ad34395-2b62-58fb-8a63-7b4899460290@collabora.com \
    --to=andrealmeid@collabora.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=hch@lst.de \
    --cc=kunit-dev@googlegroups.com \
    --cc=leandro.ribeiro@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lucmaga@gmail.com \
    --cc=nfraprado@collabora.com \
    --cc=shuah@kernel.org \
    --cc=tales.aparecida@gmail.com \
    --cc=vitor@massaru.org \
    --cc=~lkcamp/patches@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).