Lines Matching full:kunit
3 //! KUnit-based macros for Rust unit tests.
5 //! C header: [`include/kunit/test.h`](srctree/include/kunit/test.h)
7 //! Reference: <https://docs.kernel.org/dev-tools/kunit/index.html>
15 /// Prints a KUnit error-level message.
17 /// Public but hidden since it should only be used from KUnit generated code.
31 /// Prints a KUnit info-level message.
33 /// Public but hidden since it should only be used from KUnit generated code.
51 /// Unlike the one in `core`, this one does not panic; instead, it is mapped to the KUnit
70 // The assertion failed but this task is not running a KUnit test, so we cannot call
71 // KUnit, but at least print an error to the kernel log. This may happen if this
76 // This mimics KUnit's failed assertion format.
77 $crate::kunit::err(format_args!(
81 $crate::kunit::err(format_args!(
84 $crate::kunit::err(format_args!(
85 " Failure not reported to KUnit since this is a non-KUnit task\n"
117 // `kunit_get_current_test()` and it was not null. This means we are in a KUnit
118 // test, and that the pointer can be passed to KUnit functions and assertions.
130 // next test runs, that test failures should be fixed and that KUnit is explicitly
145 // by KUnit.
157 /// Unlike the one in `core`, this one does not panic; instead, it is mapped to the KUnit
164 // KUnit supports only a few types (e.g. integers).
201 run_case: unsafe extern "C" fn(*mut kernel::bindings::kunit), in kunit_case() argument
235 /// Registers a KUnit test suite.
245 /// extern "C" fn test_fn(_test: *mut kernel::bindings::kunit) {
252 /// kernel::kunit::kunit_case(kernel::c_str!("name"), test_fn),
253 /// kernel::kunit::kunit_case_null(),
318 /// Returns whether we are currently running a KUnit test.
322 /// currently running a KUnit test or not.
329 /// # use kernel::kunit::in_kunit_test;
343 // when KUnit is not enabled). in in_kunit_test()