diff options
| author | Yury Norov <ynorov@nvidia.com> | 2026-04-16 23:15:28 -0400 |
|---|---|---|
| committer | Miguel Ojeda <ojeda@kernel.org> | 2026-06-08 02:30:33 +0200 |
| commit | e74b7a3f5aee02c7df33c79991fd867ce421051b (patch) | |
| tree | f514ec9cfedf616ccaebc49b4703ef6362741798 /rust/kernel/str.rs | |
| parent | 90b67443f04a6dde73111fbcf5ae5cb91cf3e14b (diff) | |
| download | lwn-e74b7a3f5aee02c7df33c79991fd867ce421051b.tar.gz lwn-e74b7a3f5aee02c7df33c79991fd867ce421051b.zip | |
rust: tests: add Kconfig for KUnit test
There are 6 individual Rust KUnit test suites (plus the doctests one). All
the tests are compiled unconditionally now, which adds ~200 kB to the
kernel image for me on x86_64. As Rust matures, this bloating will
inevitably grow.
Add Kconfig.test which includes a RUST_KUNIT_TESTS menu, and all
individual tests under it.
As usual, new tests are all enabled if KUNIT_ALL_TESTS=y.
Suggested-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
Reviewed-by: David Gow <david@davidgow.net>
Acked-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260417031531.315281-3-ynorov@nvidia.com
[ Fixed capitalization. Used singular for "API" for consistency.
Reworded to clarify these are suites and that there exists
the doctests one (which is the biggest at the moment by
far). - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/str.rs')
| -rw-r--r-- | rust/kernel/str.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs index 8311d91549e1..a435674f05ea 100644 --- a/rust/kernel/str.rs +++ b/rust/kernel/str.rs @@ -415,6 +415,7 @@ macro_rules! c_str { }}; } +#[cfg(CONFIG_RUST_STR_KUNIT_TEST)] #[kunit_tests(rust_kernel_str)] mod tests { use super::*; |
