[lkml]   [2022]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3/3] Documentation: kunit: rewrite section on .kunitconfig
This section was slightly out of date and redundant.
* the `note` was obsolete since commit 4c2911f1e140 ("kunit: tool:
reconfigure when the used kunitconfig changes")
* we don't want users to grab the default config manually, running config/build/run will do that for them as noted in the
section above.

This rewrite tries to pull back the curtain and show that .kunitconfig
isn't magic by giving some example commands a user can run to emulate

Signed-off-by: Daniel Latypov <>
Documentation/dev-tools/kunit/run_wrapper.rst | 47 +++++++------------
1 file changed, 17 insertions(+), 30 deletions(-)

diff --git a/Documentation/dev-tools/kunit/run_wrapper.rst b/Documentation/dev-tools/kunit/run_wrapper.rst
index 1fccf2e099f7..e0ddd18f8c2e 100644
--- a/Documentation/dev-tools/kunit/run_wrapper.rst
+++ b/Documentation/dev-tools/kunit/run_wrapper.rst
@@ -57,45 +57,32 @@ To view kunit_tool flags (optional command-line arguments), run:

./tools/testing/kunit/ run --help

-Create a ``.kunitconfig`` File
-If we want to run a specific set of tests (rather than those listed
-in the KUnit ``defconfig``), we can provide Kconfig options in the
-``.kunitconfig`` file. For default .kunitconfig, see:
-A ``.kunitconfig`` is a ``minconfig`` (a .config
-generated by running ``make savedefconfig``), used for running a
-specific set of tests. This file contains the regular Kernel configs
-with specific test targets. The ``.kunitconfig`` also
-contains any other config options required by the tests (For example:
-dependencies for features under tests, configs that enable/disable
-certain code blocks, arch configs and so on).

-To create a ``.kunitconfig``, using the KUnit ``defconfig``:
+We mentioned it above, but a ``.kunitconfig`` is a *minconfig*, i.e. you only
+need to specify the options you care about, e.g.

.. code-block::

- cp tools/testing/kunit/configs/default.config .kunit/.kunitconfig

-We can then add any other Kconfig options. For example:
+Concretely, here's more or less what `` run`` does by default:

-.. code-block::
+.. code-block:: bash

+ $ cp $KUNITCONFIG .kunit/.config
+ $ make O=.kunit ARCH=um olddefconfig
+ $ make O=.kunit ARCH=um -j `nproc`
+ $ .kunit/linux </dev/null 2>&1 | ./tools/testing/kunit/ parse

-kunit_tool ensures that all config options in ``.kunitconfig`` are
-set in the kernel ``.config`` before running the tests. It warns if we
-have not included the options dependencies.
+See `Parse Test Results`_ for more details about `` parse``.

-.. note:: Removing something from the ``.kunitconfig`` will
- not rebuild the ``.config file``. The configuration is only
- updated if the ``.kunitconfig`` is not a subset of ``.config``.
- This means that we can use other tools
- (For example: ``make menuconfig``) to adjust other config options.
- The build dir needs to be set for ``make menuconfig`` to
- work, therefore by default use ``make O=.kunit menuconfig``.
+ .. note:: Note: ``make olddefconfig`` will drop ``CONFIG`` options that aren't visible
+ (e.g. are inside an unsatisfied ``if`` block) or have missing dependencies.
+ will validate every option in ``$KUNITCONFIG`` is present in the final
+ ``.config``, so it should be safer and less error-prone than doing this manually.

Configure, Build, and Run Tests
 \ /
  Last update: 2022-06-03 21:58    [W:0.396 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site