rust: kunit: add KUnit case and suite macros
Add a couple of Rust const functions and macros to allow to develop KUnit tests without relying on generated C code: - The `kunit_unsafe_test_suite!` Rust macro is similar to the `kunit_test_suite` C macro. It requires a NULL-terminated array of test cases (see below). - The `kunit_case` Rust function is similar to the `KUNIT_CASE` C macro. It generates as case from the name and function. - The `kunit_case_null` Rust function generates a NULL test case, which is to be used as delimiter in `kunit_test_suite!`. While these functions and macros can be used on their own, a future patch will introduce another macro to create KUnit tests using a user-space like syntax. Signed-off-by:José Expósito <jose.exposito89@gmail.com> Co-developed-by:
Matt Gilbride <mattgilbride@google.com> Signed-off-by:
Matt Gilbride <mattgilbride@google.com> Co-developed-by:
Miguel Ojeda <ojeda@kernel.org> Signed-off-by:
Miguel Ojeda <ojeda@kernel.org> Co-developed-by:
David Gow <davidgow@google.com> Signed-off-by:
David Gow <davidgow@google.com> Link: https://lore.kernel.org/r/20250307090103.918788-2-davidgow@google.com [ Applied Markdown in comment. - Miguel ] Signed-off-by:
Miguel Ojeda <ojeda@kernel.org>
Loading
Please register or sign in to comment