kselftest: add fixture variants
authorJakub Kicinski <kuba@kernel.org>
Tue, 28 Apr 2020 01:03:50 +0000 (18:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Apr 2020 20:30:44 +0000 (13:30 -0700)
commit74bc7c97fa88ae334752e7b45702d23813df8873
tree85ea60123871db4f56afd2d3fbe9808ede92d210
parente7f304607778e31bfd8e6b00ce2a8f990b265e14
kselftest: add fixture variants

Allow users to build parameterized variants of fixtures.

If fixtures want variants, they call FIXTURE_VARIANT() to declare
the structure to fill for each variant. Each fixture will be re-run
for each of the variants defined by calling FIXTURE_VARIANT_ADD()
with the differing parameters initializing the structure.

Since tests are being re-run, additional initialization (steps,
no_print) is also added.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/dev-tools/kselftest.rst
tools/testing/selftests/kselftest_harness.h