mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 09:44:51 +01:00
The convention for KUnit tests is to have the test kconfig options visible only when the code they depend on is already enabled. This way only the tests that are relevant to the particular kernel build can be enabled, either manually or via KUNIT_ALL_TESTS. Update lib/crypto/tests/Kconfig to follow that convention, i.e. depend on the corresponding library options rather than selecting them. This fixes an issue where enabling KUNIT_ALL_TESTS enabled non-test code. This does mean that it becomes a bit more difficult to enable *all* the crypto library tests (which is what I do as a maintainer of the code), since doing so will now require enabling other options that select the libraries. Regardless, we should follow the standard KUnit convention. I'll also add a .kunitconfig file that does enable all these options. Note: currently most of the crypto library options are selected by visible options in crypto/Kconfig, which can be used to enable them without too much trouble. If in the future we end up with more cases like CRYPTO_LIB_CURVE25519 which is selected only by WIREGUARD (thus making CRYPTO_LIB_CURVE25519_KUNIT_TEST effectively depend on WIREGUARD after this commit), we could consider adding a new kconfig option that enables all the library code specifically for testing. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Closes: https://lore.kernel.org/r/CAMuHMdULzMdxuTVfg8_4jdgzbzjfx-PHkcgbGSthcUx_sHRNMg@mail.gmail.com Fixes: |
||
|---|---|---|
| .. | ||
| blake2b-testvecs.h | ||
| blake2b_kunit.c | ||
| blake2s-testvecs.h | ||
| blake2s_kunit.c | ||
| curve25519_kunit.c | ||
| hash-test-template.h | ||
| Kconfig | ||
| Makefile | ||
| md5-testvecs.h | ||
| md5_kunit.c | ||
| mldsa-testvecs.h | ||
| mldsa_kunit.c | ||
| nh-testvecs.h | ||
| nh_kunit.c | ||
| poly1305-testvecs.h | ||
| poly1305_kunit.c | ||
| polyval-testvecs.h | ||
| polyval_kunit.c | ||
| sha1-testvecs.h | ||
| sha1_kunit.c | ||
| sha3-testvecs.h | ||
| sha3_kunit.c | ||
| sha224-testvecs.h | ||
| sha224_kunit.c | ||
| sha256-testvecs.h | ||
| sha256_kunit.c | ||
| sha384-testvecs.h | ||
| sha384_kunit.c | ||
| sha512-testvecs.h | ||
| sha512_kunit.c | ||