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