Skip to content
Commit 8c2254d0 authored by David Gow's avatar David Gow Committed by Greg Kroah-Hartman
Browse files

kunit: Fix result propagation for parameterised tests

[ Upstream commit 384426bd

 ]

When one parameter of a parameterised test failed, its failure would be
propagated to the overall test, but not to the suite result (unless it
was the last parameter).

This is because test_case->success was being reset to the test->success
result after each parameter was used, so a failing test's result would
be overwritten by a non-failing result. The overall test result was
handled in a third variable, test_result, but this was discarded after
the status line was printed.

Instead, just propagate the result after each parameter run.

Signed-off-by: default avatarDavid Gow <davidgow@google.com>
Fixes: fadb08e7

 ("kunit: Support for Parameterized Testing")
Reviewed-by: default avatarMarco Elver <elver@google.com>
Reviewed-by: default avatarBrendan Higgins <brendanhiggins@google.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 55cb127f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment