Commit Graph
12 Commits
Author SHA1 Message Date
Ryota Sakamoto 8b8f1d5e35 kunit: Add documentation of --list_suites
Commit 60f3ada4174f ("kunit: Add --list_suites to show suites") introduced
the --list_suites option to kunit.py, but the update to the corresponding
run_wrapper documentation was omitted.

Add the missing description for --list_suites to keep the documentation in
sync with the tool's supported arguments.

Fixes: 60f3ada4174f ("kunit: Add --list_suites to show suites")
Signed-off-by: Ryota Sakamoto <[email protected]>
Reviewed-by: David Gow <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2026-03-09 10:46:02 -06:00
Ryota Sakamoto db0c35ca36 kunit: add bash completion
Currently, kunit.py has many subcommands and options, making it difficult
to remember them without checking the help message.

Add --list-cmds and --list-opts to kunit.py to get available commands and
options, use those outputs in kunit-completion.sh to show completion.

This implementation is similar to perf and tools/perf/perf-completion.sh.

Example output:
  $ source tools/testing/kunit/kunit-completion.sh
  $ ./tools/testing/kunit/kunit.py [TAB][TAB]
  build   config  exec    parse   run
  $ ./tools/testing/kunit/kunit.py run --k[TAB][TAB]
  --kconfig_add  --kernel_args  --kunitconfig

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: David Gow <[email protected]>
Signed-off-by: Ryota Sakamoto <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2026-01-20 11:17:52 -07:00
Thomas Weißschuh 6cf6b0a6f2 kunit: tool: Implement listing of available architectures
To implement custom scripting around kunit.py it is useful to get a list of
available architectures. While it is possible to manually inspect
tools/testing/kunit/qemu_configs/, this is annoying to implement and
introduces a dependency on a kunit.py implementation detail.

Introduce 'kunit.py run --arch help' which lists all known architectures
in an easy to parse list. This is equivalent on how QEMU implements
listing of possible argument values.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Rae Moar <[email protected]>
Reviewed-by: David Gow <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2025-04-15 10:54:50 -06:00
Rae Moar e588586675 kunit: Add documentation of KUnit test attributes
Add documentation on the use of test attributes under the section "Tips for
Running KUnit Tests" in the KUnit docs.

Documentation includes three sections on how to mark tests with attributes,
how attributes are reported, and how the user can filter tests using test
attributes.

Add descriptions of new flags to list of command-line arguments.

Reviewed-by: David Gow <[email protected]>
Signed-off-by: Rae Moar <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2023-07-26 13:29:46 -06:00
David Gow e98c4f6afc Documentation: kunit: Update description of --alltests option
kunit_tool's --alltests option was changed in commit
980ac3ad05 ("kunit: tool: rename all_test_uml.config, use it for --alltests")
to use a manually curated list of architecture-indpendent Kconfig
options, rather than attempting to use make allyesconfig on UML, which
was broken.

Update the kunit_tool documentation to reflect the new behaviour of
--alltests.

Signed-off-by: David Gow <[email protected]>
Reviewed-by: Daniel Latypov <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2022-10-07 10:19:25 -06:00
Tales Aparecida 5ceb9a2558 Documentation: KUnit: avoid repeating "kunit.py run" in start.rst
Combine two sections mentioning "kunit.py run" to streamline the
getting-started guide. Update "kunit.py run" expected output in
the guide and run_wrapper.

Signed-off-by: Tales Aparecida <[email protected]>
Reviewed-by: Maíra Canal <[email protected]>
Reviewed-by: Sadiya Kazi<[email protected]>
Reviewed-by: David Gow <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2022-09-30 13:20:42 -06:00
Tales Aparecida 2327f7e956 Documentation: KUnit: remove duplicated docs for kunit_tool
Delete "kunit-tool.rst" to remove repeated info from KUnit docs.
"What is kunit_tool?" was integrated into index.rst, the remaining
sections were moved into run_wrapper.rst and renamed as follows:

"What is a .kunitconfig?" -> "Creating a ``.kunitconfig`` file"
"Getting Started with kunit_tool" -> "Running tests with kunit_tool"
"Configuring, Building, and Running Tests" ->
	"Configuring, building, and running tests"
"Running Tests on QEMU" -> "Running tests on QEMU"
"Parsing Test Results" -> "Parsing test results"
"Filtering Tests" -> "Filtering tests"
"Other Useful Options" -> "Running command-line arguments"

Signed-off-by: Tales Aparecida <[email protected]>
Reviewed-by: Sadiya Kazi <[email protected]>
Reviewed-by: David Gow <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2022-09-30 13:20:33 -06:00
Tales Aparecida 43ca52a910 Documentation: KUnit: Fix non-uml anchor
The section was rewritten but its anchor got left behind.
Fix the anchor and add some references to running on QEMU.

Signed-off-by: Tales Aparecida <[email protected]>
Reviewed-by: David Gow <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2022-09-30 13:19:03 -06:00
Tales Aparecida 7e2d619411 Documentation: kunit: fix trivial typo
Missing closing block-quote

Signed-off-by: Tales Aparecida <[email protected]>
Reviewed-by: David Gow <[email protected]>
Reviewed-by: Sadiya Kazi <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2022-09-30 13:18:46 -06:00
Sadiya Kazi 957063874c Documentation: kunit: Add CLI args for kunit_tool
Some kunit_tool command line arguments are missing in run_wrapper.rst.
Document them.

Reported-by: Bagas Sanjaya <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reviewed-by: David Gow <[email protected]>
Reviewed-by: Brendan Higgins <[email protected]>
Reviewed-by: Daniel Latypov <[email protected]>
Reviewed-by: Maíra Canal <[email protected]>
Signed-off-by: Sadiya Kazi <[email protected]>
Reviewed-by: Bagas Sanjaya <[email protected]>
Tested-by: Bagas Sanjaya <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2022-07-26 14:48:38 -06:00
David Gow 7635778bac Documentation: kunit: Cleanup run_wrapper, fix x-ref
The "Run Tests on qemu" section of run_wrapper.rst had a few issues left
over from the last big documentation refactor[1]:
- It referenced a non_uml.rst page, which was integrated into the other
  pages (including run_wrapper.rst).
- It skimmed over the use of --arch= and --cross_compile= in favour of
  using a custom --qemu_config. Since most users will want to use the
  former, let's give examples.

Remove the reference to the non-existant page, and add a couple of
examples to encourage the use of --arch= and --cross_compile=.

With this change, there should be no more broken references in the KUnit
documentation (i.e., the one mentioned in [2] is gone).

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=46201d47d6c4be594c1d57b7f3251c371626a9c4
[2]: https://lore.kernel.org/linux-doc/[email protected]/

Signed-off-by: David Gow <[email protected]>
Reviewed-by: Brendan Higgins <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2022-07-08 11:36:03 -06:00
Harinder Singh 46201d47d6 Documentation: kunit: Reorganize documentation related to running tests
Consolidate documentation running tests into two pages: "run tests with
kunit_tool" and "run tests without kunit_tool".

Signed-off-by: Harinder Singh <[email protected]>
Reviewed-by: Tim Bird <[email protected]>
Reviewed-by: Brendan Higgins <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Corbet <[email protected]>
2021-12-23 12:49:43 -07:00