Re: [PATCH v4 3/3] printf: implicate test line in failure messages

2025-02-19 Thread Tamir Duberstein
On Wed, Feb 19, 2025 at 3:41 PM Rasmus Villemoes wrote: > > On Fri, 14 Feb 2025 at 22:53, Tamir Duberstein wrote: > > > > This improves the failure output by pointing to the failing line at the > > top level of the test, e.g.: > > # test_number: EXPECTATION FA

[PATCH v4 3/3] printf: implicate test line in failure messages

2025-02-14 Thread Tamir Duberstein
ce ' # test_number: EXPECTATION FAILED at lib/printf_kunit.c:142 lib/printf_kunit.c:167: kvasprintf(..., "%#-12x", ...) returned '0x1234abcd ', expected '0x1234abce ' Signed-off-by: Tamir Duberstein --- lib/tests/printf_kunit.c | 60 +++

[PATCH v4 2/3] printf: break kunit into test cases

2025-02-14 Thread Tamir Duberstein
Move all tests into `printf_test_cases`. This gives us nicer output in the event of a failure. Combine `plain_format` and `plain_hash` into `hash_pointer` since they're testing the same scenario. Signed-off-by: Tamir Duberstein --- lib/tests/printf_kunit.c

[PATCH v4 1/3] printf: convert self-test to KUnit

2025-02-14 Thread Tamir Duberstein
Convert the printf() self-test to a KUnit test. In the interest of keeping the patch reasonably-sized this doesn't refactor the tests into proper parameterized tests - it's all one big test case. Signed-off-by: Tamir Duberstein --- Documentation/core-api/printk-formats.r

[PATCH v4 0/3] printf: convert self-test to KUnit

2025-02-14 Thread Tamir Duberstein
[0]. Link: https://lore.kernel.org/all/20250204-scanf-kunit-convert-v3-0-386d7c3ee...@gmail.com/T/#u [0] Signed-off-by: Tamir Duberstein --- 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

Re: [PATCH v3 0/2] printf: convert self-test to KUnit

2025-02-14 Thread Tamir Duberstein
On Fri, Feb 14, 2025 at 4:47 PM Rasmus Villemoes wrote: > > On Fri, 14 Feb 2025 at 17:53, Tamir Duberstein wrote: > > > > On Fri, Feb 14, 2025 at 11:02 AM Andy Shevchenko > > wrote: > > > > > > On Fri, Feb 14, 2025 at 04:35:12PM +0100, Petr Mladek w

Re: [PATCH v3 0/2] printf: convert self-test to KUnit

2025-02-14 Thread Tamir Duberstein
On Fri, Feb 14, 2025 at 11:02 AM Andy Shevchenko wrote: > > On Fri, Feb 14, 2025 at 04:35:12PM +0100, Petr Mladek wrote: > > On Mon 2025-02-10 13:23:21, Tamir Duberstein wrote: > > > This is one of just 3 remaining "Test Module" kselftests (the others > >

[PATCH v3 2/2] printf: break kunit into test cases

2025-02-10 Thread Tamir Duberstein
Move all tests into `printf_test_cases`. This gives us nicer output in the event of a failure. Combine `plain_format` and `plain_hash` into `hash_pointer` since they're testing the same scenario. Signed-off-by: Tamir Duberstein --- lib/printf_kunit.c

[PATCH v3 1/2] printf: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
Convert the printf() self-test to a KUnit test. In the interest of keeping the patch reasonably-sized this doesn't refactor the tests into proper parameterized tests - it's all one big test case. Signed-off-by: Tamir Duberstein --- Documentation/core-api/printk-formats

[PATCH v3 0/2] printf: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
[0]. Link: https://lore.kernel.org/all/20250204-scanf-kunit-convert-v3-0-386d7c3ee...@gmail.com/T/#u [0] Signed-off-by: Tamir Duberstein --- Changes in v3: - Remove extraneous trailing newlines from failure messages. - Replace `pr_warn` with `kunit_warn`. - Drop arch changes. - Remove KUnit boiler