Kconfig 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #
  2. # KUnit base configuration
  3. #
  4. menuconfig KUNIT
  5. tristate "KUnit - Enable support for unit tests"
  6. select GLOB
  7. help
  8. Enables support for kernel unit tests (KUnit), a lightweight unit
  9. testing and mocking framework for the Linux kernel. These tests are
  10. able to be run locally on a developer's workstation without a VM or
  11. special hardware when using UML. Can also be used on most other
  12. architectures. For more information, please see
  13. Documentation/dev-tools/kunit/.
  14. if KUNIT
  15. config KUNIT_DEBUGFS
  16. bool "KUnit - Enable /sys/kernel/debug/kunit debugfs representation" if !KUNIT_ALL_TESTS
  17. default KUNIT_ALL_TESTS
  18. help
  19. Enable debugfs representation for kunit. Currently this consists
  20. of /sys/kernel/debug/kunit/<test_suite>/results files for each
  21. test suite, which allow users to see results of the last test suite
  22. run that occurred.
  23. config KUNIT_FAULT_TEST
  24. bool "Enable KUnit tests which print BUG stacktraces"
  25. depends on KUNIT_TEST
  26. depends on !UML
  27. default !PANIC_ON_OOPS
  28. help
  29. Enables fault handling tests for the KUnit framework. These tests may
  30. trigger a kernel BUG(), and the associated stack trace, even when they
  31. pass. If this conflicts with your test infrastrcture (or is confusing
  32. or annoying), they can be disabled by setting this to N.
  33. config KUNIT_TEST
  34. tristate "KUnit test for KUnit" if !KUNIT_ALL_TESTS
  35. default KUNIT_ALL_TESTS
  36. help
  37. Enables the unit tests for the KUnit test framework. These tests test
  38. the KUnit test framework itself; the tests are both written using
  39. KUnit and test KUnit. This option should only be enabled for testing
  40. purposes by developers interested in testing that KUnit works as
  41. expected.
  42. config KUNIT_EXAMPLE_TEST
  43. tristate "Example test for KUnit" if !KUNIT_ALL_TESTS
  44. default KUNIT_ALL_TESTS
  45. help
  46. Enables an example unit test that illustrates some of the basic
  47. features of KUnit. This test only exists to help new users understand
  48. what KUnit is and how it is used. Please refer to the example test
  49. itself, lib/kunit/example-test.c, for more information. This option
  50. is intended for curious hackers who would like to understand how to
  51. use KUnit for kernel development.
  52. config KUNIT_ALL_TESTS
  53. tristate "All KUnit tests with satisfied dependencies"
  54. help
  55. Enables all KUnit tests, if they can be enabled.
  56. KUnit tests run during boot and output the results to the debug log
  57. in TAP format (http://testanything.org/). Only useful for kernel devs
  58. running the KUnit test harness, and not intended for inclusion into a
  59. production build.
  60. For more information on KUnit and unit tests in general please refer
  61. to the KUnit documentation in Documentation/dev-tools/kunit/.
  62. If unsure, say N.
  63. config KUNIT_DEFAULT_ENABLED
  64. bool "Default value of kunit.enable"
  65. default y
  66. help
  67. Sets the default value of kunit.enable. If set to N then KUnit
  68. tests will not execute unless kunit.enable=1 is passed to the
  69. kernel command line.
  70. In most cases this should be left as Y. Only if additional opt-in
  71. behavior is needed should this be set to N.
  72. config KUNIT_AUTORUN_ENABLED
  73. bool "Default value of kunit.autorun"
  74. default y
  75. help
  76. Sets the default value of kunit.autorun. If set to N then KUnit
  77. tests will not run after initialization unless kunit.autorun=1 is
  78. passed to the kernel command line. The test can still be run manually
  79. via debugfs interface.
  80. In most cases this should be left as Y. Only if additional opt-in
  81. behavior is needed should this be set to N.
  82. config KUNIT_DEFAULT_FILTER_GLOB
  83. string "Default value of the filter_glob module parameter"
  84. help
  85. Sets the default value of kunit.filter_glob. If set to a non-empty
  86. string only matching tests are executed.
  87. If unsure, leave empty so all tests are executed.
  88. config KUNIT_DEFAULT_FILTER
  89. string "Default value of the filter module parameter"
  90. help
  91. Sets the default value of kunit.filter. If set to a non-empty
  92. string only matching tests are executed.
  93. If unsure, leave empty so all tests are executed.
  94. config KUNIT_DEFAULT_FILTER_ACTION
  95. string "Default value of the filter_action module parameter"
  96. help
  97. Sets the default value of kunit.filter_action. If set to a non-empty
  98. string only matching tests are executed.
  99. If unsure, leave empty so all tests are executed.
  100. config KUNIT_DEFAULT_TIMEOUT
  101. int "Default value of the timeout module parameter"
  102. default 300
  103. help
  104. Sets the default timeout, in seconds, for Kunit test cases. This value
  105. is further multiplied by a factor determined by the assigned speed
  106. setting: 1x for `DEFAULT`, 3x for `KUNIT_SPEED_SLOW`, and 12x for
  107. `KUNIT_SPEED_VERY_SLOW`. This allows slower tests on slower machines
  108. sufficient time to complete.
  109. If unsure, the default timeout of 300 seconds is suitable for most
  110. cases.
  111. config KUNIT_UML_PCI
  112. bool "KUnit UML PCI Support"
  113. depends on UML
  114. select UML_PCI
  115. help
  116. Enables the PCI subsystem on UML for use by KUnit tests.
  117. Some KUnit tests require the PCI core which is not enabled by
  118. default on UML.
  119. If unsure, say N.
  120. endif # KUNIT