]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kunit: Add example parameterized test with shared resource management using the Resou...
authorMarie Zhussupova <marievic@google.com>
Tue, 26 Aug 2025 09:13:35 +0000 (17:13 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 27 Aug 2025 05:36:03 +0000 (23:36 -0600)
commita03e3caa0e961cadbab18ed104fb2c20a254c50d
tree4e126ebc9006920cf509117f2f8b8a3c1700b441
parentb820b9077b7f4008cc44a40261aefa681c63c7d3
kunit: Add example parameterized test with shared resource management using the Resource API

Add example_params_test_with_init() to illustrate how to manage
shared resources across a parameterized KUnit test. This example
showcases the use of the new param_init() function and its registration
to a test using the KUNIT_CASE_PARAM_WITH_INIT() macro.

Additionally, the test demonstrates how to directly pass a parameter array
to the parameterized test context via kunit_register_params_array()
and leveraging the Resource API for shared resource management.

Link: https://lore.kernel.org/r/20250826091341.1427123-6-davidgow@google.com
Reviewed-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Marie Zhussupova <marievic@google.com>
Signed-off-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
lib/kunit/kunit-example-test.c