On Thu, 18 Dec 2025 at 15:20, Ojaswin Mujoo <
oja...@linux.ibm.com> wrote:
> So looking into this a bit more and comparing the parameterized output
> with non parameterized output, I'm seeing that the difference is that
> output via KUNIT_CASE_PARAM is not printing the test plan line right
> here. This plan sort of serves as divider between the parent and the 3
> children's logs and without it our parsing logic gets confused. When I
> manually added a "1..3" test plan I could see the parsing work correctly
> without any changes to kunit_parser.py.
>
Thanks for looking into this!
There's been a bit of back-and-forth on how to include the test plan
line for the parameterised tests: it's not always possible to know how
many times a test will run in advance if the gen_params function is
particularly complicated.
We did have a workaround where array parameters would record the array
size, but there were a couple of tests which were wrapping the
gen_params function to skip / add entries which weren't in the array.
One "fix" would be to use KUNIT_CASE_PARAM_WITH_INIT() and have an
init function which calls kunit_register_params_array(), and then use
kunit_array_gen_params() as the generator function: this has an escape
hatch which will print the test plan.
Otherwise, as a hack, you could effectively revert
https://lore.kernel.org/linux-kselftest/20250821135447.1...@google.com/
— which would fix the issue (but break some other tests).
Going through and fixing this properly has been on my to-do list; with
some combination of fixing tests which modify the gen_params function
and improving the parsing to better handle cases without the test
plan.
Cheers,
-- David