Skip to content

rust: kunit: enforce test configurability

Yury Norov linux-doc linux-kselftest lkml nova-gpu rust-for-linux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2gpu: nova-core: add a KUnit test configuration optiondrivers/gpu/nova-core/Kconfig drivers/gpu/nova-core/gsp/cmdq/continuation.rs+13 -01 reply
2/2rust: kunit: move test configuration gating into macroDocumentation/rust/testing.rst drivers/gpu/nova-core/gsp/cmdq/continuation.rs rust/kernel/alloc/allocator.rs +8 more+43 -281 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchDavid Gow
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] rust: kunit: enforce test configurability

Make every Rust KUnit test suite require the Kconfig option that controls it, and let the kunit_tests macro apply the corresponding #[cfg] attribute.

Most Rust KUnit suites currently combine a separate #[cfg] attribute with #[kunit_tests]. The macro does not enforce this pattern, however, and the Nova continuation suite currently has no dedicated test option.

Add a Nova Core KUnit option first and use it to guard the existing suite. Then require a controlling Kconfig symbol in kunit_tests by moving the guard into the macro. Update all callers and documentation as well.

Yury Norov (2):
gpu: nova-core: add a KUnit test configuration option
rust: kunit: move test configuration gating into macro

 Documentation/rust/testing.rst                | 11 ++++---
 drivers/gpu/nova-core/Kconfig                 | 12 ++++++++
 .../gpu/nova-core/gsp/cmdq/continuation.rs    |  2 +-
 rust/kernel/alloc/allocator.rs                |  3 +-
 rust/kernel/alloc/kvec.rs                     |  3 +-
 rust/kernel/bitfield.rs                       |  3 +-
 rust/kernel/bitmap.rs                         |  3 +-
 rust/kernel/kunit.rs                          |  3 +-
 rust/kernel/str.rs                            |  3 +-
 rust/kernel/sync/atomic/predefine.rs          |  3 +-
 rust/macros/kunit.rs                          | 30 +++++++++++++++++--
 rust/macros/lib.rs                            |  6 ++--
 12 files changed, 55 insertions(+), 27 deletions(-)

base-commit: aaa4e12f32b6552db1469a796312b25a0def7164

Signature · 1 line
2.53.0