Brendan Higgins | 914cc63 | 2019-09-23 02:02:31 -0700 | [diff] [blame] | 1 | # |
| 2 | # KUnit base configuration |
| 3 | # |
| 4 | |
| 5 | menuconfig KUNIT |
Alan Maguire | 9fe124b | 2020-01-06 22:28:22 +0000 | [diff] [blame] | 6 | tristate "KUnit - Enable support for unit tests" |
Daniel Latypov | 5d31f71 | 2021-02-05 16:08:52 -0800 | [diff] [blame] | 7 | select GLOB if KUNIT=y |
Brendan Higgins | 914cc63 | 2019-09-23 02:02:31 -0700 | [diff] [blame] | 8 | help |
| 9 | Enables support for kernel unit tests (KUnit), a lightweight unit |
| 10 | testing and mocking framework for the Linux kernel. These tests are |
| 11 | able to be run locally on a developer's workstation without a VM or |
| 12 | special hardware when using UML. Can also be used on most other |
| 13 | architectures. For more information, please see |
| 14 | Documentation/dev-tools/kunit/. |
Brendan Higgins | d8e2a76 | 2019-09-23 02:02:37 -0700 | [diff] [blame] | 15 | |
| 16 | if KUNIT |
| 17 | |
Alan Maguire | e2219db | 2020-03-26 14:25:07 +0000 | [diff] [blame] | 18 | config KUNIT_DEBUGFS |
Anders Roxell | beaed42 | 2020-05-11 15:14:25 +0200 | [diff] [blame] | 19 | bool "KUnit - Enable /sys/kernel/debug/kunit debugfs representation" if !KUNIT_ALL_TESTS |
| 20 | default KUNIT_ALL_TESTS |
Alan Maguire | e2219db | 2020-03-26 14:25:07 +0000 | [diff] [blame] | 21 | help |
| 22 | Enable debugfs representation for kunit. Currently this consists |
| 23 | of /sys/kernel/debug/kunit/<test_suite>/results files for each |
| 24 | test suite, which allow users to see results of the last test suite |
| 25 | run that occurred. |
| 26 | |
Brendan Higgins | d8e2a76 | 2019-09-23 02:02:37 -0700 | [diff] [blame] | 27 | config KUNIT_TEST |
Anders Roxell | beaed42 | 2020-05-11 15:14:25 +0200 | [diff] [blame] | 28 | tristate "KUnit test for KUnit" if !KUNIT_ALL_TESTS |
| 29 | default KUNIT_ALL_TESTS |
Brendan Higgins | d8e2a76 | 2019-09-23 02:02:37 -0700 | [diff] [blame] | 30 | help |
| 31 | Enables the unit tests for the KUnit test framework. These tests test |
| 32 | the KUnit test framework itself; the tests are both written using |
| 33 | KUnit and test KUnit. This option should only be enabled for testing |
| 34 | purposes by developers interested in testing that KUnit works as |
| 35 | expected. |
| 36 | |
| 37 | config KUNIT_EXAMPLE_TEST |
Anders Roxell | beaed42 | 2020-05-11 15:14:25 +0200 | [diff] [blame] | 38 | tristate "Example test for KUnit" if !KUNIT_ALL_TESTS |
| 39 | default KUNIT_ALL_TESTS |
Brendan Higgins | d8e2a76 | 2019-09-23 02:02:37 -0700 | [diff] [blame] | 40 | help |
| 41 | Enables an example unit test that illustrates some of the basic |
| 42 | features of KUnit. This test only exists to help new users understand |
| 43 | what KUnit is and how it is used. Please refer to the example test |
| 44 | itself, lib/kunit/example-test.c, for more information. This option |
| 45 | is intended for curious hackers who would like to understand how to |
| 46 | use KUnit for kernel development. |
| 47 | |
Anders Roxell | 92238b3 | 2020-05-11 15:14:20 +0200 | [diff] [blame] | 48 | config KUNIT_ALL_TESTS |
| 49 | tristate "All KUnit tests with satisfied dependencies" |
| 50 | help |
| 51 | Enables all KUnit tests, if they can be enabled. |
| 52 | KUnit tests run during boot and output the results to the debug log |
| 53 | in TAP format (http://testanything.org/). Only useful for kernel devs |
| 54 | running the KUnit test harness, and not intended for inclusion into a |
| 55 | production build. |
| 56 | |
| 57 | For more information on KUnit and unit tests in general please refer |
| 58 | to the KUnit documentation in Documentation/dev-tools/kunit/. |
| 59 | |
| 60 | If unsure, say N. |
| 61 | |
Brendan Higgins | d8e2a76 | 2019-09-23 02:02:37 -0700 | [diff] [blame] | 62 | endif # KUNIT |