-
- Downloads
xarray: port tests to kunit
Minimally rewrite the XArray unit tests to use kunit. This integrates nicely with existing kunit tools which produce nicer human-readable output compared to the existing machinery. Running the xarray tests before this change requires an obscure invocation ``` tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 \ --kconfig_add CONFIG_TEST_XARRAY=y --raw_output=all nothing ``` which on failure produces ``` BUG at check_reserve:513 ... XArray: 6782340 of 6782364 tests passed ``` and exits 0. Running the xarray tests after this change requires a simpler invocation ``` tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 \ xarray ``` which on failure produces (colors omitted) ``` [09:50:53] ====================== check_reserve ====================== [09:50:53] [FAILED] param-0 [09:50:53] # check_reserve: EXPECTATION FAILED at lib/test_xarray.c:536 [09:50:53] xa_erase(xa, 12345678) != NULL ... [09:50:53] # module: test_xarray [09:50:53] # xarray: pass:26 fail:3 skip:0 total:29 [09:50:53] # Totals: pass:28 fail:3 skip:0 total:31 [09:50:53] ===================== [FAILED] xarray ====================== ``` and exits 1. Use of richer kunit assertions is intentionally omitted to reduce the scope of the change. [akpm@linux-foundation.org: fix cocci warning] Link: https://lore.kernel.org/oe-kbuild-all/202412081700.YXB3vBbg-lkp@intel.com/ Link: https://lkml.kernel.org/r/20241205-xarray-kunit-port-v1-1-ee44bc7aa201@gmail.com Signed-off-by:Tamir Duberstein <tamird@gmail.com> Cc: Bill Wendling <morbo@google.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Justin Stitt <justinstitt@google.com> Cc: Madhavan Srinivasan <maddy@linux.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Naveen N Rao <naveen@kernel.org> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org>
Showing
- arch/m68k/configs/amiga_defconfig 0 additions, 1 deletionarch/m68k/configs/amiga_defconfig
- arch/m68k/configs/apollo_defconfig 0 additions, 1 deletionarch/m68k/configs/apollo_defconfig
- arch/m68k/configs/atari_defconfig 0 additions, 1 deletionarch/m68k/configs/atari_defconfig
- arch/m68k/configs/bvme6000_defconfig 0 additions, 1 deletionarch/m68k/configs/bvme6000_defconfig
- arch/m68k/configs/hp300_defconfig 0 additions, 1 deletionarch/m68k/configs/hp300_defconfig
- arch/m68k/configs/mac_defconfig 0 additions, 1 deletionarch/m68k/configs/mac_defconfig
- arch/m68k/configs/multi_defconfig 0 additions, 1 deletionarch/m68k/configs/multi_defconfig
- arch/m68k/configs/mvme147_defconfig 0 additions, 1 deletionarch/m68k/configs/mvme147_defconfig
- arch/m68k/configs/mvme16x_defconfig 0 additions, 1 deletionarch/m68k/configs/mvme16x_defconfig
- arch/m68k/configs/q40_defconfig 0 additions, 1 deletionarch/m68k/configs/q40_defconfig
- arch/m68k/configs/sun3_defconfig 0 additions, 1 deletionarch/m68k/configs/sun3_defconfig
- arch/m68k/configs/sun3x_defconfig 0 additions, 1 deletionarch/m68k/configs/sun3x_defconfig
- arch/powerpc/configs/ppc64_defconfig 0 additions, 1 deletionarch/powerpc/configs/ppc64_defconfig
- lib/Kconfig.debug 16 additions, 2 deletionslib/Kconfig.debug
- lib/Makefile 1 addition, 1 deletionlib/Makefile
- lib/test_xarray.c 393 additions, 278 deletionslib/test_xarray.c
Loading