Re: [PATCH 0/3] rust: add Kconfig.test

From: Gary Guo

Date: Fri Apr 17 2026 - 10:16:50 EST


On Fri Apr 17, 2026 at 4:15 AM BST, Yury Norov wrote:
> There are 6 individual Rust KUnit tests. All the tests are compiled
> unconditionally now, which adds ~200 kB to the kernel image on my
> x86_64 buld. As Rust matures, this bloating will inevitably grow.
>
> Add Kconfig.test, which provides a RUST_KUNIT_TESTS menu, and all
> individual tests under it.
>
> Yury Norov (3):
> rust: tests: drop 'use crate' in bitmap and atomic KUnit tests
> rust: testing: add Kconfig for KUnit test
> Documentation: rust: testing: add Kconfig guidance

Acked-by: Gary Guo <gary@xxxxxxxxxxx>

>
> Documentation/rust/testing.rst | 5 ++-
> init/Kconfig | 2 +
> rust/kernel/Kconfig.test | 76 ++++++++++++++++++++++++++++
> rust/kernel/alloc/allocator.rs | 1 +
> rust/kernel/alloc/kvec.rs | 1 +
> rust/kernel/bitmap.rs | 5 +--
> rust/kernel/kunit.rs | 1 +
> rust/kernel/str.rs | 1 +
> rust/kernel/sync/atomic/predefine.rs | 5 +--
> 9 files changed, 79 insertions(+), 7 deletions(-)
> create mode 100644 rust/kernel/Kconfig.test