Re: [PATCH v2 1/3] rust: kunit: add #[should_panic] support
From: Miguel Ojeda
Date: Mon Nov 02 2026 - 15:01:38 EST
On Mon, Nov 2, 2026 at 3:58 PM Nicolás Antinori
<nico.antinori.7@xxxxxxxxx> wrote:
>
> To solve this I created a new config "RUST_KUNIT_SHOULD_PANIC_ATTRIBUTE"
> that depends on !UML && !PANIC_ON_OOPS && BUG. If the test is annotated
> with `#[should_panic]` and CONFIG_RUST_KUNIT_SHOULD_PANIC_ATTRIBUTE=n,
> the test won't run and won't show up in the summary.
I was wondering if we needed the flexibility, i.e. if we could just
simply disable them when the conditions are not satisfied, but I guess
given `CONFIG_KUNIT_FAULT_TEST`'s existing description, it may make
sense to have a new Kconfig symbol -- do the ones added here look
similar in the kernel log to those fault ones?
(And I was wondering because, in general, adding Kconfig symbols has a
price: users may get confused etc.).
Cheers,
Miguel