mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-06-21 15:43:21 +02:00
7f502747bc
Add KUnit tests to make sure the macro is working correctly. The unit tests are put behind the new `RUST_BITFIELD_KUNIT_TEST` Kconfig option. Acked-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com> [acourbot: - Use a consistent test axis where each test focuses on a single thing. - Rename members to generic name including range for readability. - Add test exercising `try_with`. - Add test checking that unallocated bits are left untouched. ] Co-developed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Yury Norov <ynorov@nvidia.com> Link: https://patch.msgid.link/20260606-bitfield-v5-2-b92188820914@nvidia.com [ Prefixed test suite name with `rust_` as mentioned. Markdown-formatted a few comments with Markdown. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
87 lines
2.3 KiB
Plaintext
87 lines
2.3 KiB
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
menuconfig RUST_KUNIT_TESTS
|
|
bool "Rust KUnit tests"
|
|
depends on KUNIT && RUST
|
|
default KUNIT_ALL_TESTS
|
|
help
|
|
This menu collects all options for Rust KUnit tests.
|
|
See Documentation/rust/testing.rst for how to protect
|
|
unit tests with these options.
|
|
|
|
Say Y here to enable Rust KUnit tests.
|
|
|
|
If unsure, say N.
|
|
|
|
if RUST_KUNIT_TESTS
|
|
config RUST_ALLOCATOR_KUNIT_TEST
|
|
bool "KUnit tests for Rust allocator API" if !KUNIT_ALL_TESTS
|
|
default KUNIT_ALL_TESTS
|
|
help
|
|
This option enables KUnit tests for the Rust allocator API.
|
|
These are only for development and testing, not for regular
|
|
kernel use cases.
|
|
|
|
If unsure, say N.
|
|
|
|
config RUST_KVEC_KUNIT_TEST
|
|
bool "KUnit tests for Rust KVec API" if !KUNIT_ALL_TESTS
|
|
default KUNIT_ALL_TESTS
|
|
help
|
|
This option enables KUnit tests for the Rust KVec API.
|
|
These are only for development and testing, not for
|
|
regular kernel use cases.
|
|
|
|
If unsure, say N.
|
|
|
|
config RUST_BITMAP_KUNIT_TEST
|
|
bool "KUnit tests for Rust bitmap API" if !KUNIT_ALL_TESTS
|
|
default KUNIT_ALL_TESTS
|
|
help
|
|
This option enables KUnit tests for the Rust bitmap API.
|
|
These are only for development and testing, not for regular
|
|
kernel use cases.
|
|
|
|
If unsure, say N.
|
|
|
|
config RUST_KUNIT_SELFTEST
|
|
bool "KUnit selftests for Rust" if !KUNIT_ALL_TESTS
|
|
default KUNIT_ALL_TESTS
|
|
help
|
|
This option enables KUnit selftests. These are only
|
|
for development and testing, not for regular kernel
|
|
use cases.
|
|
|
|
If unsure, say N.
|
|
|
|
config RUST_STR_KUNIT_TEST
|
|
bool "KUnit tests for Rust strings API" if !KUNIT_ALL_TESTS
|
|
default KUNIT_ALL_TESTS
|
|
help
|
|
This option enables KUnit tests for the Rust strings API.
|
|
These are only for development and testing, not for regular
|
|
kernel use cases.
|
|
|
|
If unsure, say N.
|
|
|
|
config RUST_ATOMICS_KUNIT_TEST
|
|
bool "KUnit tests for Rust atomics API" if !KUNIT_ALL_TESTS
|
|
default KUNIT_ALL_TESTS
|
|
help
|
|
This option enables KUnit tests for the Rust atomics API.
|
|
These are only for development and testing, not for regular
|
|
kernel use cases.
|
|
|
|
If unsure, say N.
|
|
|
|
config RUST_BITFIELD_KUNIT_TEST
|
|
bool "KUnit tests for the Rust `bitfield!` macro" if !KUNIT_ALL_TESTS
|
|
default KUNIT_ALL_TESTS
|
|
help
|
|
This option enables KUnit tests for the Rust `bitfield!` macro.
|
|
These are only for development and testing, not for regular
|
|
kernel use cases.
|
|
|
|
If unsure, say N.
|
|
|
|
endif
|