mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
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>
This commit is contained in:
committed by
Kees Cook
parent
9ab61886ac
commit
313b38a6ec
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user