linux-yocto/lib/kunit
Carlos Llamas 8080c67dd5 kunit: prevent log overwrite in param_tests
When running parameterized tests, each test case is initialized with
kunit_init_test(). This function takes the test_case->log as a parameter
but it clears it via string_stream_clear() on each iteration.

This results in only the log from the last parameter being preserved in
the test_case->log and the results from the previous parameters are lost
from the debugfs entry.

Fix this by manually setting the param_test.log to the test_case->log
after it has been initialized. This prevents kunit_init_test() from
clearing the log on each iteration.

Link: https://lore.kernel.org/r/20251024190101.2091549-1-cmllamas@google.com
Fixes: 4b59300ba4 ("kunit: Add parent kunit for parameterized test context")
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2025-10-27 11:13:31 -06:00
..
.kunitconfig
assert_test.c
assert.c
attributes.c
debugfs.c kunit: Introduce autorun option 2025-01-15 09:04:06 -07:00
debugfs.h
device-impl.h
device.c kunit: Device wrappers should also manage driver name 2024-08-26 07:03:46 -06:00
executor_test.c kunit: executor: Simplify string allocation handling 2024-07-12 10:11:48 -06:00
executor.c kunit: executor: Remove const from kunit_filter_suites() allocation type 2025-04-29 12:48:27 -06:00
hooks-impl.h
hooks.c
Kconfig kunit: Extend kconfig help text for KUNIT_UML_PCI 2025-09-16 08:27:09 -06:00
kunit-example-test.c kunit: Add example parameterized test with direct dynamic parameter array setup 2025-08-26 23:36:03 -06:00
kunit-test.c kunit: test_dev_action: Correctly cast 'priv' pointer to long* 2025-10-20 13:08:05 -06:00
Makefile kunit: Always descend into kunit directory during build 2025-08-15 11:39:46 -06:00
platform-test.c platform: Add test managed platform_device/driver APIs 2024-07-29 15:33:12 -07:00
platform.c platform: Add test managed platform_device/driver APIs 2024-07-29 15:33:12 -07:00
resource.c
static_stub.c kunit: Fix wrong parameter to kunit_deactivate_static_stub() 2025-05-21 09:51:23 -06:00
string-stream-test.c kunit: string-stream-test: Include <linux/prandom.h> 2024-10-03 18:20:14 +02:00
string-stream.c
string-stream.h
test.c kunit: prevent log overwrite in param_tests 2025-10-27 11:13:31 -06:00
try-catch-impl.h kunit: Adjust kunit_test timeout based on test_{suite,case} speed 2025-06-24 20:47:39 -06:00
try-catch.c kunit: Adjust kunit_test timeout based on test_{suite,case} speed 2025-06-24 20:47:39 -06:00
user_alloc.c kunit: test: Export kunit_attach_mm() 2025-07-16 14:11:58 +02:00