From: Kees Cook <keescook@chromium.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: shuah@kernel.org, luto@amacapital.net, wad@chromium.org,
linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 4/5] kselftest: add fixture parameters
Date: Fri, 13 Mar 2020 17:05:22 -0700 [thread overview]
Message-ID: <202003131705.F6D0FD73@keescook> (raw)
In-Reply-To: <20200313165202.37d921cf@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On Fri, Mar 13, 2020 at 04:52:02PM -0700, Jakub Kicinski wrote:
> On Fri, 13 Mar 2020 16:31:25 -0700 Kees Cook wrote:
> > > @@ -326,7 +387,8 @@
> > > } \
> > > static void fixture_name##_##test_name( \
> > > struct __test_metadata __attribute__((unused)) *_metadata, \
> > > - FIXTURE_DATA(fixture_name) __attribute__((unused)) *self)
> > > + FIXTURE_DATA(fixture_name) __attribute__((unused)) *self, \
> > > + const FIXTURE_PARAMS(fixture_name) __attribute__((unused)) *params)
> >
> > Could this be done without expanding the function arguments? (i.e. can
> > the params just stay attached to the __test_metadata, perhaps having the
> > test runner adjust a new "current_param" variable to point to the
> > current param? Having everything attached to the single __test_metadata
> > makes a lot of things easier, IMO.
>
> Sure! I felt a little awkward dereferencing _metadata in the test,
> so I followed the example of self. But I can change.
>
> Can I add a macro like CURRENT_PARAM() that would implicitly use
> _metadata?
Yeah, that seems cleaner. Thanks! This is very cool. :)
--
Kees Cook
next prev parent reply other threads:[~2020-03-14 0:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-13 3:17 [PATCH 0/5] kselftest: add fixture parameters Jakub Kicinski
2020-03-13 3:17 ` [PATCH 1/5] selftests/seccomp: use correct FIXTURE macro Jakub Kicinski
2020-03-13 23:21 ` Kees Cook
2020-03-13 3:17 ` [PATCH 2/5] kselftest: create fixture objects Jakub Kicinski
2020-03-13 23:23 ` Kees Cook
2020-03-13 3:17 ` [PATCH 3/5] kselftest: run tests by fixture Jakub Kicinski
2020-03-13 23:27 ` Kees Cook
2020-03-13 23:54 ` Jakub Kicinski
2020-03-13 3:17 ` [PATCH 4/5] kselftest: add fixture parameters Jakub Kicinski
2020-03-13 23:31 ` Kees Cook
2020-03-13 23:52 ` Jakub Kicinski
2020-03-14 0:05 ` Kees Cook [this message]
2020-03-13 3:17 ` [PATCH 5/5] selftests: tls: run all tests for TLS 1.2 and TLS 1.3 Jakub Kicinski
2020-03-13 23:26 ` Kees Cook
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=202003131705.F6D0FD73@keescook \
--to=keescook@chromium.org \
--cc=kernel-team@fb.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=netdev@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=wad@chromium.org \
/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).