diff mbox series

[v3,2/3] kunit: Fix reporting of the skipped parameterized tests

Message ID 20230517111816.984-3-michal.wajdeczko@intel.com (mailing list archive)
State Accepted
Commit b08f75b9bb0196a626a804e76970733f0a05de94
Delegated to: Brendan Higgins
Headers show
Series kunit: Fix reporting of the skipped parameterized tests | expand

Commit Message

Michal Wajdeczko May 17, 2023, 11:18 a.m. UTC
Logs from the parameterized tests that were skipped don't include
SKIP directive thus they are displayed as PASSED. Fix that.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: David Gow <davidgow@google.com>
Reviewed-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
---
 lib/kunit/test.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/kunit/test.c b/lib/kunit/test.c
index f5e4ceffd282..af48d0761d26 100644
--- a/lib/kunit/test.c
+++ b/lib/kunit/test.c
@@ -627,9 +627,11 @@  int kunit_run_tests(struct kunit_suite *suite)
 
 				kunit_log(KERN_INFO, &test,
 					  KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT
-					  "%s %d %s",
+					  "%s %d %s%s%s",
 					  kunit_status_to_ok_not_ok(test.status),
-					  test.param_index + 1, param_desc);
+					  test.param_index + 1, param_desc,
+					  test.status == KUNIT_SKIPPED ? " # SKIP " : "",
+					  test.status == KUNIT_SKIPPED ? test.status_comment : "");
 
 				/* Get next param. */
 				param_desc[0] = '\0';