From: Marco Elver <elver@google.com>
To: Arpitha Raghunandan <98.arpi@gmail.com>
Cc: Brendan Higgins <brendanhiggins@google.com>,
skhan@linuxfoundation.org, Iurii Zaikin <yzaikin@google.com>,
"Theodore Ts'o" <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>,
KUnit Development <kunit-dev@googlegroups.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-ext4@vger.kernel.org
Subject: Re: [PATCH v5 1/2] kunit: Support for Parameterized Testing
Date: Fri, 6 Nov 2020 20:05:23 +0100 [thread overview]
Message-ID: <CANpmjNM-Wj0fReinwTxBC3GD7p-8qKHeao1cMYMerFd5bO1fqA@mail.gmail.com> (raw)
In-Reply-To: <11549107-7247-03a7-2469-f5aa793a0d19@gmail.com>
On Fri, 6 Nov 2020 at 20:00, Arpitha Raghunandan <98.arpi@gmail.com> wrote:
>
> On 07/11/20 12:15 am, Marco Elver wrote:
> > On Fri, 6 Nov 2020 at 19:28, Arpitha Raghunandan <98.arpi@gmail.com> wrote:
> >>
> >> Implementation of support for parameterized testing in KUnit.
> >> This approach requires the creation of a test case using the
> >> KUNIT_CASE_PARAM macro that accepts a generator function as input.
> >> This generator function should return the next parameter given the
> >> previous parameter in parameterized tests. It also provides
> >> a macro to generate common-case generators.
> >>
> >> Signed-off-by: Arpitha Raghunandan <98.arpi@gmail.com>
> >> Co-developed-by: Marco Elver <elver@google.com>
> >> Signed-off-by: Marco Elver <elver@google.com>
> > [...]
> >> - kunit_suite_for_each_test_case(suite, test_case)
> >> - kunit_run_case_catch_errors(suite, test_case);
> >> + kunit_suite_for_each_test_case(suite, test_case) {
> >> + struct kunit test = { .param_value = NULL, .param_index = 0 };
> >> + bool test_success = true;
> >> +
> >> + if (test_case->generate_params)
> >> + test.param_value = test_case->generate_params(NULL);
> >> +
> >> + do {
> >> + kunit_run_case_catch_errors(suite, test_case, &test);
> >> + test_success &= test_case->success;
> >> +
> >> + if (test_case->generate_params) {
> >> + kunit_log(KERN_INFO, &test,
> >> + KUNIT_SUBTEST_INDENT
> >> + "# %s: param-%d %s",
> >> + test_case->name, test.param_index,
> >> + kunit_status_to_string(test.success));
> >
> > Sorry, I still found something. The patch I sent had this aligned with
> > the '(', whereas when I apply this patch it no longer is aligned. Why?
> >
> > I see the rest of the file also aligns arguments with opening '(', so
> > I think your change is inconsistent.
> >
>
> Ah those lines had spaces instead of tab and I think I messed up the alignment
> fixing that. I will send another version fixing this.
> Thanks!
It was tabs then <8 spaces to align. checkpatch.pl certainly is happy with that.
> > Thanks,
> > -- Marco
> >
>
prev parent reply other threads:[~2020-11-06 19:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 18:26 [PATCH v5 1/2] kunit: Support for Parameterized Testing Arpitha Raghunandan
2020-11-06 18:28 ` [PATCH v5 2/2] fs: ext4: Modify inode-test.c to use KUnit parameterized testing feature Arpitha Raghunandan
2020-11-06 18:38 ` Marco Elver
2020-11-06 18:37 ` [PATCH v5 1/2] kunit: Support for Parameterized Testing Marco Elver
2020-11-06 18:45 ` Marco Elver
2020-11-06 19:00 ` Arpitha Raghunandan
2020-11-06 19:05 ` Marco Elver [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=CANpmjNM-Wj0fReinwTxBC3GD7p-8qKHeao1cMYMerFd5bO1fqA@mail.gmail.com \
--to=elver@google.com \
--cc=98.arpi@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=brendanhiggins@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=tytso@mit.edu \
--cc=yzaikin@google.com \
/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).