workflows.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/3] printf: convert self-test to KUnit
@ 2025-03-07 22:08 Tamir Duberstein
  2025-03-07 22:08 ` [PATCH v6 1/3] " Tamir Duberstein
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Tamir Duberstein @ 2025-03-07 22:08 UTC (permalink / raw)
  To: Arpitha Raghunandan, David Gow, Petr Mladek, Steven Rostedt,
	Andy Shevchenko, Rasmus Villemoes, Sergey Senozhatsky,
	Andrew Morton, Shuah Khan, Jonathan Corbet, Geert Uytterhoeven,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Naveen N Rao, Brendan Higgins
  Cc: linux-kernel, linux-kselftest, linux-doc, linux-m68k,
	linuxppc-dev, workflows, Tamir Duberstein

This is one of just 3 remaining "Test Module" kselftests (the others
being bitmap and scanf), the rest having been converted to KUnit.

I tested this using:

$ tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 printf

I have also sent out a series converting scanf[0].

Link: https://lore.kernel.org/all/20250204-scanf-kunit-convert-v3-0-386d7c3ee714@gmail.com/T/#u [0]

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
Changes in v6:
- Use __printf correctly on `__test`. (Petr Mladek)
- Rebase on linux-next.
- Remove leftover references to `printf.sh`.
- Update comment in `hash_pointer`. (Petr Mladek)
- Avoid overrun in `KUNIT_EXPECT_MEMNEQ`. (Petr Mladek)
- Restore trailing newlines on printk strings and add some missing ones.
  (Petr Mladek)
- Use `kunit_skip` on not-yet-initialized crng. (Petr Mladek)
- Link to v5: https://lore.kernel.org/r/20250221-printf-kunit-convert-v5-0-5db840301730@gmail.com

Changes in v5:
- Update `do_test` `__printf` annotation (Rasmus Villemoes).
- Link to v4: https://lore.kernel.org/r/20250214-printf-kunit-convert-v4-0-c254572f1565@gmail.com

Changes in v4:
- Add patch "implicate test line in failure messages".
- Rebase on linux-next, move scanf_kunit.c into lib/tests/.
- Link to v3: https://lore.kernel.org/r/20250210-printf-kunit-convert-v3-0-ee6ac5500f5e@gmail.com

Changes in v3:
- Remove extraneous trailing newlines from failure messages.
- Replace `pr_warn` with `kunit_warn`.
- Drop arch changes.
- Remove KUnit boilerplate from CONFIG_PRINTF_KUNIT_TEST help text.
- Restore `total_tests` counting.
- Remove tc_fail macro in last patch.
- Link to v2: https://lore.kernel.org/r/20250207-printf-kunit-convert-v2-0-057b23860823@gmail.com

Changes in v2:
- Incorporate code review from prior work[0] by Arpitha Raghunandan.
- Link to v1: https://lore.kernel.org/r/20250204-printf-kunit-convert-v1-0-ecf1b846a4de@gmail.com

Link: https://lore.kernel.org/lkml/20200817043028.76502-1-98.arpi@gmail.com/t/#u [0]

---
Tamir Duberstein (3):
      printf: convert self-test to KUnit
      printf: break kunit into test cases
      printf: implicate test line in failure messages

 Documentation/core-api/printk-formats.rst   |   4 +-
 Documentation/dev-tools/kselftest.rst       |   2 +-
 MAINTAINERS                                 |   2 +-
 lib/Kconfig.debug                           |  12 +-
 lib/Makefile                                |   1 -
 lib/tests/Makefile                          |   1 +
 lib/{test_printf.c => tests/printf_kunit.c} | 442 ++++++++++++----------------
 tools/testing/selftests/kselftest/module.sh |   2 +-
 tools/testing/selftests/lib/Makefile        |   2 +-
 tools/testing/selftests/lib/config          |   1 -
 tools/testing/selftests/lib/printf.sh       |   4 -
 11 files changed, 207 insertions(+), 266 deletions(-)
---
base-commit: 7ec162622e66a4ff886f8f28712ea1b13069e1aa
change-id: 20250131-printf-kunit-convert-fd4012aa2ec6

Best regards,
-- 
Tamir Duberstein <tamird@gmail.com>


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

end of thread, other threads:[~2025-03-13 17:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-07 22:08 [PATCH v6 0/3] printf: convert self-test to KUnit Tamir Duberstein
2025-03-07 22:08 ` [PATCH v6 1/3] " Tamir Duberstein
2025-03-07 22:08 ` [PATCH v6 2/3] printf: break kunit into test cases Tamir Duberstein
2025-03-07 22:08 ` [PATCH v6 3/3] printf: implicate test line in failure messages Tamir Duberstein
2025-03-08  4:49 ` [PATCH v6 0/3] printf: convert self-test to KUnit Kees Cook
2025-03-08 12:51   ` Tamir Duberstein
2025-03-08 12:52     ` Tamir Duberstein
2025-03-13 16:15       ` Petr Mladek
2025-03-13 16:06 ` Petr Mladek
2025-03-13 17:28 ` Kees Cook

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