Pull kunit updates from Shuah Khan: - New parameterized test features KUnit parameterized tests supported two primary methods for getting parameters: - Defining custom logic within a generate_params() function. - Using the KUNIT_ARRAY_PARAM() and KUNIT_ARRAY_PARAM_DESC() macros with a pre-defined static array and passing the created *_gen_params() to KUNIT_CASE_PARAM(). These methods present limitations when dealing with dynamically generated parameter arrays, or in scenarios where populating parameters sequentially via generate_params() is inefficient or overly complex. These limitations are fixed with a parameterized test method - Fix issues in kunit build artifacts cleanup - Fix parsing skipped test problem in kselftest framework - Enable PCI on UML without triggering WARN() - a few other fixes and adds support for new configs such as MIPS * tag 'linux_kselftest-kunit-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kunit: Extend kconfig help text for KUNIT_UML_PCI rust: kunit: allow `cfg` on `test`s kunit: qemu_configs: Add MIPS configurations kunit: Enable PCI on UML without triggering WARN() Documentation: kunit: Document new parameterized test features kunit: Add example parameterized test with direct dynamic parameter array setup kunit: Add example parameterized test with shared resource management using the Resource API kunit: Enable direct registration of parameter arrays to a KUnit test kunit: Pass parameterized test context to generate_params() kunit: Introduce param_init/exit for parameterized test context management kunit: Add parent kunit for parameterized test context kunit: tool: Accept --raw_output=full as an alias of 'all' kunit: tool: Parse skipped tests from kselftest.h kunit: Always descend into kunit directory during build
Showing the changes to rust/kernel (1 of 20 files). Show all
Unified · Split
| @@ -210,6 +210,8 @@ pub const fn kunit_case( · 209 unmodified lines | |||
| 210 | status: kernel::bindings::kunit_status_KUNIT_SUCCESS, | 210 | status: kernel::bindings::kunit_status_KUNIT_SUCCESS, |
| 211 | module_name: core::ptr::null_mut(), | 211 | module_name: core::ptr::null_mut(), |
| 212 | log: core::ptr::null_mut(), | 212 | log: core::ptr::null_mut(), |
| 213 | param_init: None, | ||
| 214 | param_exit: None, | ||
| 213 | } | 215 | } |
| 214 | } | 216 | } |
| 215 | 217 | ||
| @@ -229,6 +231,8 @@ pub const fn kunit_case_null() -> kernel::bindings::kunit_case { · 13 unmodified lines | |||
| 229 | status: kernel::bindings::kunit_status_KUNIT_SUCCESS, | 231 | status: kernel::bindings::kunit_status_KUNIT_SUCCESS, |
| 230 | module_name: core::ptr::null_mut(), | 232 | module_name: core::ptr::null_mut(), |
| 231 | log: core::ptr::null_mut(), | 233 | log: core::ptr::null_mut(), |
| 234 | param_init: None, | ||
| 235 | param_exit: None, | ||
| 232 | } | 236 | } |
| 233 | } | 237 | } |
| 234 | 238 | ||
| @@ -357,4 +361,11 @@ mod tests { · 122 unmodified lines | |||
| 357 | fn rust_test_kunit_in_kunit_test() { | 361 | fn rust_test_kunit_in_kunit_test() { |
| 358 | assert!(in_kunit_test()); | 362 | assert!(in_kunit_test()); |
| 359 | } | 363 | } |
| 364 | |||
| 365 | #[test] | ||
| 366 | #[cfg(not(all()))] | ||
| 367 | fn rust_test_kunit_always_disabled_test() { | ||
| 368 | // This test should never run because of the `cfg`. | ||
| 369 | assert!(false); | ||
| 370 | } | ||
| 360 | } | 371 | } |