Skip to content

Commit f0b6203

Browse files
sj-awsshuahkh
authored andcommitted
Documentation: kunit: Update Kconfig parts for KUNIT's module support
If 'CONFIG_KUNIT=m', letting kunit tests that do not support loadable module build depends on 'KUNIT' instead of 'KUNIT=y' result in compile errors. This commit updates the document for this. Fixes: 9fe124b ("kunit: allow kunit to be loaded as a module") Signed-off-by: SeongJae Park <sjpark@amazon.de> Reviewed-by: David Gow <davidgow@google.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 7f32b10 commit f0b6203

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Documentation/dev-tools/kunit/start.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Now add the following to ``drivers/misc/Kconfig``:
197197
198198
config MISC_EXAMPLE_TEST
199199
bool "Test for my example"
200-
depends on MISC_EXAMPLE && KUNIT
200+
depends on MISC_EXAMPLE && KUNIT=y
201201
202202
and the following to ``drivers/misc/Makefile``:
203203

Documentation/dev-tools/kunit/usage.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ Once the kernel is built and installed, a simple
561561
562562
...will run the tests.
563563

564+
.. note::
565+
Note that you should make sure your test depends on ``KUNIT=y`` in Kconfig
566+
if the test does not support module build. Otherwise, it will trigger
567+
compile errors if ``CONFIG_KUNIT`` is ``m``.
568+
564569
Writing new tests for other architectures
565570
-----------------------------------------
566571

0 commit comments

Comments
 (0)