diff options
| author | David Gow <david@davidgow.net> | 2026-06-27 16:29:19 +0800 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2026-07-06 09:31:20 -0600 |
| commit | 7eac3330517472ea06590c14e683db694ed7a28e (patch) | |
| tree | 3a54afaee1d92c6a2413315d41ff1870d3ec7d26 /Documentation/dev-tools | |
| parent | 643ec8ff7d8ed15881bd05d71de24208ce0dadcb (diff) | |
Documentation: kunit: Test Kconfig entries shouldn't select other configs
Add a note to the Kconfig section of style.rst to use 'depends on' rather
than 'selects' for dependencies, as this can cause users of
CONFIG_KUNIT_ALL_TESTS to suddenly grow unexpected dependencies.
Link: https://lore.kernel.org/r/20260627082921.1709181-1-david@davidgow.net
Signed-off-by: David Gow <david@davidgow.net>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'Documentation/dev-tools')
| -rw-r--r-- | Documentation/dev-tools/kunit/style.rst | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Documentation/dev-tools/kunit/style.rst b/Documentation/dev-tools/kunit/style.rst index eac81a714a29..449f9f816fc7 100644 --- a/Documentation/dev-tools/kunit/style.rst +++ b/Documentation/dev-tools/kunit/style.rst @@ -164,9 +164,10 @@ This Kconfig entry must: * be visible only if ``CONFIG_KUNIT_ALL_TESTS`` is not enabled. * have a default value of ``CONFIG_KUNIT_ALL_TESTS``. * have a brief description of KUnit in the help text. - -If we are not able to meet above conditions (for example, the test is unable to -be built as a module), Kconfig entries for tests should be tristate. +* depend on the feature being tested, rather than selecting it (so that + enabling ``CONFIG_KUNIT_ALL_TESTS`` does not enable unrelated functionality). +* be ``tristate``, unless there is a specific reason that the test cannot be + built as a module. For example, a Kconfig entry might look like: |
