Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH 0/3] kunit: Fix reporting of the skipped parameterized tests
@ 2023-04-11 16:00 Michal Wajdeczko
  2023-04-11 16:00 ` [PATCH 1/3] kunit/test: Add example test showing parameterized testing Michal Wajdeczko
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Michal Wajdeczko @ 2023-04-11 16:00 UTC (permalink / raw)
  To: linux-kselftest, kunit-dev; +Cc: Michal Wajdeczko, David Gow

Due to the lack of the SKIP directive in the output, if any of the
parameterized test was skipped, the parser could not recognize that
correctly and was marking the test as PASSED.

This can easily be seen by running the new subtest from patch 1:

$ ./tools/testing/kunit/kunit.py run \
	--kunitconfig ./lib/kunit/.kunitconfig *.example_params*

  [ ] Starting KUnit Kernel (1/1)...
  [ ] ============================================================
  [ ] =================== example (1 subtest) ====================
  [ ] =================== example_params_test  ===================
  [ ] [PASSED] example value 2
  [ ] [PASSED] example value 1
  [ ] [PASSED] example value 0
  [ ] =============== [PASSED] example_params_test ===============
  [ ] ===================== [PASSED] example =====================
  [ ] ============================================================
  [ ] Testing complete. Ran 3 tests: passed: 3

$ ./tools/testing/kunit/kunit.py run \
	--kunitconfig ./lib/kunit/.kunitconfig *.example_params* \
	--raw_output

  [ ] Starting KUnit Kernel (1/1)...
  KTAP version 1
  1..1
      # example: initializing suite
      KTAP version 1
      # Subtest: example
      1..1
          KTAP version 1
          # Subtest: example_params_test
      # example_params_test: initializing
          ok 1 example value 2
      # example_params_test: initializing
          ok 2 example value 1
      # example_params_test: initializing
          ok 3 example value 0
      # example_params_test: pass:2 fail:0 skip:1 total:3
      ok 1 example_params_test
  # Totals: pass:2 fail:0 skip:1 total:3
  ok 1 example

After adding the SKIP directive, the report looks as expected:

  [ ] Starting KUnit Kernel (1/1)...
  [ ] ============================================================
  [ ] =================== example (1 subtest) ====================
  [ ] =================== example_params_test  ===================
  [ ] [PASSED] example value 2
  [ ] [PASSED] example value 1
  [ ] [SKIPPED] example value 0
  [ ] =============== [PASSED] example_params_test ===============
  [ ] ===================== [PASSED] example =====================
  [ ] ============================================================
  [ ] Testing complete. Ran 3 tests: passed: 2, skipped: 1

  [ ] Starting KUnit Kernel (1/1)...
  KTAP version 1
  1..1
      # example: initializing suite
      KTAP version 1
      # Subtest: example
      1..1
          KTAP version 1
          # Subtest: example_params_test
      # example_params_test: initializing
          ok 1 example value 2
      # example_params_test: initializing
          ok 2 example value 1
      # example_params_test: initializing
          ok 3 example value 0 # SKIP unsupported param value
      # example_params_test: pass:2 fail:0 skip:1 total:3
      ok 1 example_params_test
  # Totals: pass:2 fail:0 skip:1 total:3
  ok 1 example

Cc: David Gow <davidgow@google.com>

Michal Wajdeczko (3):
  kunit/test: Add example test showing parameterized testing
  kunit: Fix reporting of the skipped parameterized tests
  kunit: Update reporting function to support results from subtests

 lib/kunit/kunit-example-test.c | 34 ++++++++++++++++++++++++++++++++++
 lib/kunit/test.c               | 26 +++++++++++++++++---------
 2 files changed, 51 insertions(+), 9 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-04-14  6:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-11 16:00 [PATCH 0/3] kunit: Fix reporting of the skipped parameterized tests Michal Wajdeczko
2023-04-11 16:00 ` [PATCH 1/3] kunit/test: Add example test showing parameterized testing Michal Wajdeczko
2023-04-12 20:51   ` Rae Moar
2023-04-13  6:30     ` David Gow
2023-04-13  6:27   ` David Gow
2023-04-11 16:00 ` [PATCH 2/3] kunit: Fix reporting of the skipped parameterized tests Michal Wajdeczko
2023-04-12 19:42   ` Rae Moar
2023-04-13  6:27   ` David Gow
2023-04-11 16:00 ` [PATCH 3/3] kunit: Update reporting function to support results from subtests Michal Wajdeczko
2023-04-12 20:28   ` Rae Moar
2023-04-13  6:31     ` David Gow
2023-04-13 13:15       ` Michal Wajdeczko
2023-04-14  6:35         ` David Gow
2023-04-13  6:38   ` David Gow
2023-04-13 11:25     ` Michal Wajdeczko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox