]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Documentation: kunit: improve example on testing static functions
authorRae Moar <rmoar@google.com>
Fri, 16 May 2025 19:06:31 +0000 (19:06 +0000)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 19 May 2025 19:22:21 +0000 (13:22 -0600)
commitd208025db6d657f975790bf7775cc9a3314348aa
treeaa8617f5e293897116ef76bfb51139233721145d
parentc2493384e8110d5a4792fff4b9d46e47b78ea10a
Documentation: kunit: improve example on testing static functions

The documentation on testing static functions using the KUnit macros
VISIBLE_IF_KUNIT and EXPORT_SYMBOL_IF_KUNIT is lacking clarity and
missing key steps in the example. This has caused bugs and confusion
among developers.

Improve wording of description and add missing steps to the example.
This entails adding the "#include <kunit/visibility.h>" line and the
"MODULE_IMPORT_NS(EXPORTED_FOR_KUNIT_TESTING);" line. Both of which were
missing from the original example and key to exposing static functions.

Link: https://lore.kernel.org/r/20250516190631.1214081-1-rmoar@google.com
Signed-off-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Documentation/dev-tools/kunit/usage.rst