diff options
author | José Expósito <jose.exposito89@gmail.com> | 2025-03-07 12:00:56 +0300 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2025-03-20 14:26:42 +0300 |
commit | 22097b966f5d2be93b315c791a26d4ed9b37f195 (patch) | |
tree | 3142f79650070a402b1db75ce34e918c80e80524 /tools/testing/selftests/bpf/prog_tests/prog_array_init.c | |
parent | fb625227d540ddead4d21813410a116e9452d232 (diff) | |
download | linux-22097b966f5d2be93b315c791a26d4ed9b37f195.tar.xz |
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>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/prog_array_init.c')
0 files changed, 0 insertions, 0 deletions