diff options
| author | José Expósito <[email protected]> | 2025-03-07 09:00:56 +0000 |
|---|---|---|
| committer | Miguel Ojeda <[email protected]> | 2025-03-20 11:26:42 +0000 |
| commit | 22097b966f5d2be93b315c791a26d4ed9b37f195 (patch) | |
| tree | 3142f79650070a402b1db75ce34e918c80e80524 /rust/macros/lib.rs | |
| parent | rust: add kunitconfig (diff) | |
| download | kernel-22097b966f5d2be93b315c791a26d4ed9b37f195.tar.gz kernel-22097b966f5d2be93b315c791a26d4ed9b37f195.zip | |
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 <[email protected]>
Co-developed-by: Matt Gilbride <[email protected]>
Signed-off-by: Matt Gilbride <[email protected]>
Co-developed-by: Miguel Ojeda <[email protected]>
Signed-off-by: Miguel Ojeda <[email protected]>
Co-developed-by: David Gow <[email protected]>
Signed-off-by: David Gow <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Applied Markdown in comment. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'rust/macros/lib.rs')
0 files changed, 0 insertions, 0 deletions
