linux-sg2042/Documentation/dev-tools/kunit
Daniel Latypov 1f0e943df6 Documentation: kunit: provide guidance for testing many inputs
usage.rst goes into a detailed section about faking out classes, but
currently lacks wording about how one might idiomatically test a range
of inputs.

Add a new chapter for "Common Patterns" and group "Isolating behvaior"
and this new section under there.

Give an example of how one might test a hash function via macros/helper
funcs and a table-driven test and very briefly discuss pros and cons.

Also highlight the KUNIT_EXPECT_*_MSG() variants (that aren't mentioned
elsewhere [1]) which are particularly useful in these situations.

It is also criminally underused at the moment, only appearing in 2
tests (both written by people involved in KUnit).

[1] not even on
https://www.kernel.org/doc/html/latest/dev-tools/kunit/api/test.html

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-12-01 15:30:06 -07:00
..
api Documentation: kunit: add documentation for KUnit 2019-09-30 17:35:01 -06:00
faq.rst KUnit: Docs: fix a wording typo 2020-11-10 13:36:36 -07:00
index.rst Documentation: kunit: Add naming guidelines 2020-10-09 14:33:17 -06:00
kunit-tool.rst Documentation: kunit: Remove references to --defconfig 2020-07-17 14:08:43 -06:00
start.rst Documentation: kunit: Update Kconfig parts for KUNIT's module support 2020-10-26 13:24:46 -06:00
style.rst KUnit: Docs: style: fix some Kconfig example issues 2020-11-10 13:39:26 -07:00
usage.rst Documentation: kunit: provide guidance for testing many inputs 2020-12-01 15:30:06 -07:00