kunit: Update kunit_print_ok_not_ok function
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Wed, 17 May 2023 11:18:16 +0000 (13:18 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 26 May 2023 14:44:09 +0000 (08:44 -0600)
commitb1eaa8b2a55c9d5d22f5d2929f4d9973d6392241
treea39a40abf47df5580b78ceba35f6b520f18967a7
parentb08f75b9bb0196a626a804e76970733f0a05de94
kunit: Update kunit_print_ok_not_ok function

There is no need use opaque test_or_suite pointer and is_test flag
as we don't use anything from the suite struct. Always expect test
pointer and use NULL as indication that provided results are from
the suite so we can treat them differently.

Since results could be from nested tests, like parameterized tests,
add explicit level parameter to properly indent output messages and
thus allow to reuse this function from other places.

While around, remove small code duplication near skip directive.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: David Gow <davidgow@google.com>
Cc: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
include/kunit/test.h
lib/kunit/test.c