linux-stable/Documentation/dev-tools
Rae Moar d208025db6 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>
2025-05-19 13:22:21 -06:00
..
kunit Documentation: kunit: improve example on testing static functions 2025-05-19 13:22:21 -06:00
autofdo.rst
checkpatch.rst
checkuapi.rst
clang-format.rst
coccinelle.rst
gcov.rst
gpio-sloppy-logic-analyzer.rst
index.rst
kasan.rst
kcov.rst
kcsan.rst
kfence.rst
kmemleak.rst
kmsan.rst
kselftest.rst
ktap.rst
propeller.rst
sparse.rst
testing-devices.rst
testing-overview.rst
ubsan.rst