Re: [PATCH v2 2/3] rust: kunit: allow same test name with different #[cfg(...)]
From: Gary Guo
Date: Mon Nov 09 2026 - 09:19:39 EST
On Thu Oct 29, 2026 at 4:59 PM GMT, Nicolás Antinori via B4 Relay wrote:
> From: Nicolás Antinori <nico.antinori.7@xxxxxxxxx>
>
> Sometimes it is necessary to test the same code paths under different
> configurations. The `#[cfg(...)]` macro can be used to check if specific
> configurations are enabled and run tests accordingly.
>
> Currently, defining multiple tests with the same name under different
> `#[cfg(...)]` attributes results in a compilation error. This patch
> removes that restriction, allowing identical test names across different
> configurations.
>
> Signed-off-by: Nicolás Antinori <nico.antinori.7@xxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
> ---
> rust/kernel/kunit.rs | 22 ++++++++++++++++++++++
> rust/macros/kunit.rs | 36 ++++++++++++++++++++----------------
> 2 files changed, 42 insertions(+), 16 deletions(-)