kunit: Support for Parameterized Testing
authorArpitha Raghunandan <98.arpi@gmail.com>
Mon, 16 Nov 2020 05:40:35 +0000 (11:10 +0530)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 2 Dec 2020 23:06:49 +0000 (16:06 -0700)
commitfadb08e7c7501ed42949e646c6865ba4ec5dd948
tree1717bf3c3ce19f08c6821ee9cb20d4445fc05e75
parent0c7a7e1a8ff3fb6d01467b43c62760e6bf0afab3
kunit: Support for Parameterized Testing

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 based on arrays. Generators may also
optionally provide a human-readable description of parameters, which is
displayed where available.

Note, currently the result of each parameter run is displayed in
diagnostic lines, and only the overall test case output summarizes
TAP-compliant success or failure of all parameter runs. In future, when
supported by kunit-tool, these can be turned into subsubtest outputs.

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>
Reviewed-by: David Gow <davidgow@google.com>
Tested-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
include/kunit/test.h
lib/kunit/test.c