diff options
| author | Tamir Duberstein <tamird@gmail.com> | 2025-02-08 21:44:39 -0500 |
|---|---|---|
| committer | Kees Cook <kees@kernel.org> | 2025-02-12 14:00:11 -0800 |
| commit | 313b38a6ecb46db4002925af91b64df4f2b76d1f (patch) | |
| tree | 694644c44538fab1ee5988a94929e0b710c53ae2 /lib/Kconfig.debug | |
| parent | 9ab61886ac683e8ff1b261a1738d5e68cd645604 (diff) | |
| download | net-313b38a6ecb46db4002925af91b64df4f2b76d1f.tar.gz | |
lib/prime_numbers: convert self-test to KUnit
Extract a private header and convert the prime_numbers self-test to a
KUnit test. I considered parameterizing the test using
`KUNIT_CASE_PARAM` but didn't see how it was possible since the test
logic is entangled with the test parameter generation logic.
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Link: https://lore.kernel.org/r/20250208-prime_numbers-kunit-convert-v5-2-b0cb82ae7c7d@gmail.com
Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'lib/Kconfig.debug')
| -rw-r--r-- | lib/Kconfig.debug | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index ad172546587029..7e548b9e36b71e 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -3235,6 +3235,20 @@ config GCD_KUNIT_TEST If unsure, say N +config PRIME_NUMBERS_KUNIT_TEST + tristate "Prime number generator test" if !KUNIT_ALL_TESTS + depends on KUNIT + select PRIME_NUMBERS + default KUNIT_ALL_TESTS + help + This option enables the KUnit test suite for the {is,next}_prime_number + functions. + + Enabling this option will include tests that compare the prime number + generator functions against a brute force implementation. + + If unsure, say N + endif # RUNTIME_TESTING_MENU config ARCH_USE_MEMTEST |
