diff mbox series

[1/2] Documentation/kbuild: Document COMPILE_TEST dependencies

Message ID 20201208152857.2162093-2-geert+renesas@glider.be (mailing list archive)
State New, archived
Headers show
Series Documentation/kbuild: Document COMPILE_TEST and platform dependencies | expand

Commit Message

Geert Uytterhoeven Dec. 8, 2020, 3:28 p.m. UTC
Document best practises for using COMPILE_TEST dependencies.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 Documentation/kbuild/kconfig-language.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Arnd Bergmann Dec. 8, 2020, 3:44 p.m. UTC | #1
On Tue, Dec 8, 2020 at 4:28 PM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> Document best practises for using COMPILE_TEST dependencies.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Arnd Bergmann <arnd@arndb.de>
Masahiro Yamada Dec. 19, 2020, 4:10 p.m. UTC | #2
On Wed, Dec 9, 2020 at 12:29 AM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> Document best practises for using COMPILE_TEST dependencies.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  Documentation/kbuild/kconfig-language.rst | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst
> index 1cf1aebdd6cdf8fa..2b746332d8aa6bce 100644
> --- a/Documentation/kbuild/kconfig-language.rst
> +++ b/Documentation/kbuild/kconfig-language.rst
> @@ -553,6 +553,17 @@ with "depends on m".  E.g.::


Both applied to linux-kbuild. Thanks.

I replaced the two-spaces between sentences
because the majority in this file adopts
one-space between sentences.
(I still see some inconsistencies, though.)






>
>  limits FOO to module (=m) or disabled (=n).
>
> +Compile-testing
> +~~~~~~~~~~~~~~~
> +If a config symbol has a dependency, but the code controlled by the config
> +symbol can still be compiled if the dependency is not met, it is encouraged to
> +increase build coverage by adding an "|| COMPILE_TEST" clause to the
> +dependency.  This is especially useful for drivers for more exotic hardware, as
> +it allows continuous-integration systems to compile-test the code on a more
> +common system, and detect bugs that way.
> +Note that compile-tested code should avoid crashing when run on a system where
> +the dependency is not met.
> +
>  Kconfig recursive dependency limitations
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst
index 1cf1aebdd6cdf8fa..2b746332d8aa6bce 100644
--- a/Documentation/kbuild/kconfig-language.rst
+++ b/Documentation/kbuild/kconfig-language.rst
@@ -553,6 +553,17 @@  with "depends on m".  E.g.::
 
 limits FOO to module (=m) or disabled (=n).
 
+Compile-testing
+~~~~~~~~~~~~~~~
+If a config symbol has a dependency, but the code controlled by the config
+symbol can still be compiled if the dependency is not met, it is encouraged to
+increase build coverage by adding an "|| COMPILE_TEST" clause to the
+dependency.  This is especially useful for drivers for more exotic hardware, as
+it allows continuous-integration systems to compile-test the code on a more
+common system, and detect bugs that way.
+Note that compile-tested code should avoid crashing when run on a system where
+the dependency is not met.
+
 Kconfig recursive dependency limitations
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~