[PATCH] xarray: port tests to kunit

2024-12-06 Thread Tamir Duberstein
kunit assertions is intentionally omitted to reduce the scope of the change. Signed-off-by: Tamir Duberstein --- arch/m68k/configs/amiga_defconfig| 1 - arch/m68k/configs/apollo_defconfig | 1 - arch/m68k/configs/atari_defconfig| 1 - arch/m68k/configs/bvme6000_defconfig | 1

Re: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-08 Thread Tamir Duberstein
On Sat, Feb 8, 2025 at 12:53 PM Yury Norov wrote: > > [...] > > Take over means that you'd at least add the Co-developed-by tag. I didn't use their code - the thing being "taken over" is the work of having these debates with the maintainers. > [...] > > KUNIT is disabled in defconfig, at least o

[PATCH 1/3] bitmap: remove _check_eq_u32_array

2025-02-07 Thread Tamir Duberstein
This has been unused since commit 3aa56885e516 ("bitmap: replace bitmap_{from,to}_u32array") in 2018. Remove it to avoid the need to port it to KUnit in this series. Signed-off-by: Tamir Duberstein --- lib/test_bitmap.c | 28 1 file changed, 28 deletion

[PATCH 2/3] bitmap: convert self-test to KUnit

2025-02-07 Thread Tamir Duberstein
Convert the bitmap() 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 --- MAINTAINERS | 2 +-

[PATCH 3/3] bitmap: break kunit into test cases

2025-02-07 Thread Tamir Duberstein
Move some tests into `bitmap_test_cases` and parameterize `test_bitmap_print_buf`. This gives us nicer output in the event of a failure. Signed-off-by: Tamir Duberstein --- lib/bitmap_kunit.c | 182 ++--- 1 file changed, 89 insertions(+), 93

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

2025-02-07 Thread Tamir Duberstein
/all/20250207-printf-kunit-convert-v2-0-057b23860...@gmail.com/T/#u [0] Link: https://lore.kernel.org/all/20250207-scanf-kunit-convert-v4-0-a23e2afae...@gmail.com/T/#u [1] Link: https://lore.kernel.org/all/20240726110658.2281070-1-usama.an...@collabora.com/T/#u [2] Link: https://lore.kernel.org

[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

[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

Re: distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
On Mon, Feb 10, 2025 at 3:20 PM Yury Norov wrote: > > On Mon, Feb 10, 2025 at 11:35:48AM -0800, John Hubbard wrote: > > On 2/9/25 11:54 PM, Geert Uytterhoeven wrote: > > > On Sat, 8 Feb 2025 at 18:53, Yury Norov wrote: > > > > On Fri, Feb 07, 2025 at 03:14:0

Re: [PATCH] xarray: port tests to kunit

2025-01-29 Thread Tamir Duberstein
On Wed, Jan 29, 2025 at 5:26 PM Liam R. Howlett wrote: > > * Tamir Duberstein [250129 16:29]: > > On Wed, Jan 29, 2025 at 4:26 PM Liam R. Howlett > > wrote: > > > > > > * Sidhartha Kumar [250129 16:02]: > > > > + Liam, Matthew

Re: [PATCH] xarray: port tests to kunit

2025-01-29 Thread Tamir Duberstein
On Wed, Jan 29, 2025 at 6:11 PM Matthew Wilcox wrote: > > On Wed, Jan 29, 2025 at 06:08:22PM -0500, Tamir Duberstein wrote: > > The whole point of tools is to liberate stupid humans' brains like > > mine from mundane tasks like working out who to email. The tool wasn'

Re: [PATCH] xarray: port tests to kunit

2025-01-29 Thread Tamir Duberstein
On Wed, Jan 29, 2025 at 4:26 PM Liam R. Howlett wrote: > > * Sidhartha Kumar [250129 16:02]: > > + Liam, Matthew > > + linux-mm > > Thank you Sid. > > > > > Hello, > > > > I believe this patch needs to be reverted for now as it breaks the > > user-space build of /tools/testing/radix-tree with: >

Re: [PATCH] xarray: port tests to kunit

2025-01-29 Thread Tamir Duberstein
On Wed, Jan 29, 2025 at 6:02 PM Matthew Wilcox wrote: > > On Wed, Jan 29, 2025 at 05:33:06PM -0500, Tamir Duberstein wrote: > > > $ ./scripts/get_maintainer.pl --git lib/xarray.c > > > Matthew Wilcox > > > (supporter:XARRAY,commit_signer:1/3=33%,auth

[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 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 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

[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

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 3/3] bitmap: break kunit into test cases

2025-02-08 Thread Tamir Duberstein
On Sat, Feb 8, 2025 at 4:07 AM David Gow wrote: > > On Sat, 8 Feb 2025 at 04:14, Tamir Duberstein wrote: > > > > Move some tests into `bitmap_test_cases` and parameterize > > `test_bitmap_print_buf`. This gives us nicer output in the event of a > > failure

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 > >

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 v5 2/3] printf: break kunit into test cases

2025-02-21 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 v5 1/3] printf: convert self-test to KUnit

2025-02-21 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 v5 3/3] printf: implicate test line in failure messages

2025-02-21 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 | 62 +++

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

2025-02-21 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 v5: - Update `do_test` `__printf` annotation (Rasmus Villemoes). - Link to v4: https://lore.kernel.org/r/20250214-printf-kunit-convert-v4-0

Re: crng init: was: Re: [PATCH v5 2/3] printf: break kunit into test cases

2025-03-07 Thread Tamir Duberstein
On Fri, Mar 7, 2025 at 11:18 AM Petr Mladek wrote: > > On Fri 2025-02-21 15:34:31, Tamir Duberstein wrote: > > 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 `h

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

2025-03-07 Thread Tamir Duberstein
On Fri, Mar 7, 2025 at 11:23 AM Petr Mladek wrote: > > On Fri 2025-02-21 15:34:32, 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 FAILED at lib/prin

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

2025-03-07 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 +++

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

2025-03-07 Thread Tamir Duberstein
On Fri, Mar 7, 2025 at 11:01 AM Petr Mladek wrote: > > On Thu 2025-03-06 09:25:43, Tamir Duberstein wrote: > > On Thu, Mar 6, 2025 at 7:25 AM Petr Mladek wrote: > > > > > > On Fri 2025-02-21 15:34:30, Tamir Duberstein wrote: > > > > Conv

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

2025-03-08 Thread Tamir Duberstein
On Fri, Mar 7, 2025 at 10:55 AM Petr Mladek wrote: > > Honestly, I am not able to find how the KUNIT_FAIL() actually prints > the message. I can't find how assert_format() is defined. KUNIT_FAIL -> KUNIT_FAIL_ASSERTION -> _KUNIT_FAILED -> __kunit_do_failed_assertion -> kunit_fail -> kunit_print_s

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

2025-03-07 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 v6 2/3] printf: break kunit into test cases

2025-03-07 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 v6 0/3] printf: convert self-test to KUnit

2025-03-07 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 v6: - Use __printf correctly on `__test`. (Petr Mladek) - Rebase on linux-next. - Remove leftover references to `printf.sh`. - Update comment in `ha

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

2025-03-08 Thread Tamir Duberstein
On Fri, Mar 7, 2025 at 11:49 PM Kees Cook wrote: > > On Fri, Mar 07, 2025 at 05:08:55PM -0500, Tamir Duberstein wrote: > > This is one of just 3 remaining "Test Module" kselftests (the others > > being bitmap and scanf), the rest having been converted to KUnit.

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

2025-03-08 Thread Tamir Duberstein
On Sat, Mar 8, 2025 at 7:51 AM Tamir Duberstein wrote: > > On Fri, Mar 7, 2025 at 11:49 PM Kees Cook wrote: > > > > On Fri, Mar 07, 2025 at 05:08:55PM -0500, Tamir Duberstein wrote: > > > This is one of just 3 remaining "Test Module" kselftests (the others &g

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

2025-03-06 Thread Tamir Duberstein
On Thu, Mar 6, 2025 at 9:25 AM Tamir Duberstein wrote: > > On Thu, Mar 6, 2025 at 7:25 AM Petr Mladek wrote: > > > > On Fri 2025-02-21 15:34:30, Tamir Duberstein wrote: > > > Convert the printf() self-test to a KUnit test. > > > > > > [...] > &g

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

2025-03-06 Thread Tamir Duberstein
On Thu, Mar 6, 2025 at 11:44 AM Petr Mladek wrote: > > On Fri 2025-02-21 15:34:31, Tamir Duberstein wrote: > > 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 `h

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

2025-03-11 Thread Tamir Duberstein
On Thu, Mar 6, 2025 at 7:25 AM Petr Mladek wrote: > > On Fri 2025-02-21 15:34:30, Tamir Duberstein wrote: > > Convert the printf() self-test to a KUnit test. > > > > In the interest of keeping the patch reasonably-sized this doesn't > > refactor the tests int

Re: distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-03-21 Thread Tamir Duberstein
On Fri, Mar 21, 2025 at 2:32 PM Yury Norov wrote: > > On Fri, Mar 21, 2025 at 12:53:36PM -0400, Tamir Duberstein wrote: > > Hi all, now that the printf and scanf series have been taken via kees' > > tree[0] and sent in for v6.15-rc1[1], I wonder if we'd like to

Re: distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-03-21 Thread Tamir Duberstein
Hi all, now that the printf and scanf series have been taken via kees' tree[0] and sent in for v6.15-rc1[1], I wonder if we'd like to revisit this discussion. As I understand it, the primary objections to moving bitmap to KUnit were: - Unclear benefits. - Source churn. - Extra dependencies for ben