Skip to contentSkip to conversation

Documentation: kunit: Update Kconfig parts for KUNIT's module support

PATCH In review SeongJae Park 2 participants 2 messages Oct 21, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: kunit: Update Kconfig parts for KUNIT's module support

From: SeongJae Park <[email protected]>

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 9fe124bf1b77 ("kunit: allow kunit to be loaded as a module")

---

Changes from v2
(https://lore.kernel.org/linux-kselftest/[email protected]/)
- Fix a grammar issue (David Gow)
- Add 'Reviewed-by: David Gow <[email protected]>'

Changes from v1
(https://lore.kernel.org/linux-kselftest/[email protected]/)
- Fix a typo (Marco Elver)

---

 Documentation/dev-tools/kunit/start.rst | 2 +-
 Documentation/dev-tools/kunit/usage.rst | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
Documentation/dev-tools/kunit/start.rst +1 -1
index d23385e3e159..454f307813ea 100644
@@ -197,7 +197,7 @@ Now add the following to ``drivers/misc/Kconfig``:
 
 	config MISC_EXAMPLE_TEST
 		bool "Test for my example"
-		depends on MISC_EXAMPLE && KUNIT
+		depends on MISC_EXAMPLE && KUNIT=y
 
 and the following to ``drivers/misc/Makefile``:
 
Documentation/dev-tools/kunit/usage.rst +5 -0
index 961d3ea3ca19..62142a47488c 100644
@@ -561,6 +561,11 @@ Once the kernel is built and installed, a simple
 
 ...will run the tests.
 
+.. note::
+   Note that you should make sure your test depends on ``KUNIT=y`` in Kconfig
+   if the test does not support module build.  Otherwise, it will trigger
+   compile errors if ``CONFIG_KUNIT`` is ``m``.
+
 Writing new tests for other architectures
 -----------------------------------------
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · SeongJae Park

From: SeongJae Park <[email protected]>

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 9fe124bf1b77 ("kunit: allow kunit to be loaded as a module")