kunit: Add example parameterized test with direct dynamic parameter array setup
authorMarie Zhussupova <marievic@google.com>
Tue, 26 Aug 2025 09:13:36 +0000 (17:13 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 27 Aug 2025 05:36:03 +0000 (23:36 -0600)
commitf9687f351ff9ec3bd8b74fd7873d2b5940829a81
treeaebaf6d96d9a80af3e77cdd1f8e3e0b1d8ed42c5
parenta03e3caa0e961cadbab18ed104fb2c20a254c50d
kunit: Add example parameterized test with direct dynamic parameter array setup

Introduce example_params_test_with_init_dynamic_arr(). This new
KUnit test demonstrates directly assigning a dynamic parameter
array, using the kunit_register_params_array() macro, to a
parameterized test context.

It highlights the use of param_init() and param_exit() for
initialization and exit of a parameterized test, and their
registration to the test case with KUNIT_CASE_PARAM_WITH_INIT().

Link: https://lore.kernel.org/r/20250826091341.1427123-7-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