85 lines · plain
1#2# KUnit base configuration3#4 5menuconfig KUNIT6 tristate "KUnit - Enable support for unit tests"7 select GLOB8 help9 Enables support for kernel unit tests (KUnit), a lightweight unit10 testing and mocking framework for the Linux kernel. These tests are11 able to be run locally on a developer's workstation without a VM or12 special hardware when using UML. Can also be used on most other13 architectures. For more information, please see14 Documentation/dev-tools/kunit/.15 16if KUNIT17 18config KUNIT_DEBUGFS19 bool "KUnit - Enable /sys/kernel/debug/kunit debugfs representation" if !KUNIT_ALL_TESTS20 default KUNIT_ALL_TESTS21 help22 Enable debugfs representation for kunit. Currently this consists23 of /sys/kernel/debug/kunit/<test_suite>/results files for each24 test suite, which allow users to see results of the last test suite25 run that occurred.26 27config KUNIT_FAULT_TEST28 bool "Enable KUnit tests which print BUG stacktraces"29 depends on KUNIT_TEST30 depends on !UML31 default y32 help33 Enables fault handling tests for the KUnit framework. These tests may34 trigger a kernel BUG(), and the associated stack trace, even when they35 pass. If this conflicts with your test infrastrcture (or is confusing36 or annoying), they can be disabled by setting this to N.37 38config KUNIT_TEST39 tristate "KUnit test for KUnit" if !KUNIT_ALL_TESTS40 default KUNIT_ALL_TESTS41 help42 Enables the unit tests for the KUnit test framework. These tests test43 the KUnit test framework itself; the tests are both written using44 KUnit and test KUnit. This option should only be enabled for testing45 purposes by developers interested in testing that KUnit works as46 expected.47 48config KUNIT_EXAMPLE_TEST49 tristate "Example test for KUnit" if !KUNIT_ALL_TESTS50 default KUNIT_ALL_TESTS51 help52 Enables an example unit test that illustrates some of the basic53 features of KUnit. This test only exists to help new users understand54 what KUnit is and how it is used. Please refer to the example test55 itself, lib/kunit/example-test.c, for more information. This option56 is intended for curious hackers who would like to understand how to57 use KUnit for kernel development.58 59config KUNIT_ALL_TESTS60 tristate "All KUnit tests with satisfied dependencies"61 help62 Enables all KUnit tests, if they can be enabled.63 KUnit tests run during boot and output the results to the debug log64 in TAP format (http://testanything.org/). Only useful for kernel devs65 running the KUnit test harness, and not intended for inclusion into a66 production build.67 68 For more information on KUnit and unit tests in general please refer69 to the KUnit documentation in Documentation/dev-tools/kunit/.70 71 If unsure, say N.72 73config KUNIT_DEFAULT_ENABLED74 bool "Default value of kunit.enable"75 default y76 help77 Sets the default value of kunit.enable. If set to N then KUnit78 tests will not execute unless kunit.enable=1 is passed to the79 kernel command line.80 81 In most cases this should be left as Y. Only if additional opt-in82 behavior is needed should this be set to N.83 84endif # KUNIT85