linux-next/arch/powerpc
Tamir Duberstein 1c11b09ea0 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.

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>
2024-12-18 19:51:32 -08:00
..
boot powerpc/64: Remove maple platform 2024-10-29 23:01:52 +11:00
configs xarray: port tests to kunit 2024-12-18 19:51:32 -08:00
crypto module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
include - The series "resource: A couple of cleanups" from Andy Shevchenko 2024-11-25 16:09:48 -08:00
kernel powerpc/prom_init: Fixup missing powermac #size-cells 2024-11-27 10:41:10 +05:30
kexec powerpc/kexec: Fix return of uninitialized variable 2024-11-15 00:29:46 +11:00
kvm The biggest change here is eliminating the awful idea that KVM had, of 2024-11-23 16:00:50 -08:00
lib powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
net powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
perf powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
platforms powerpc/machdep: Remove duplicated include in svm.c 2024-11-27 10:38:17 +05:30
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev powerpc/xive: Use cpumask_intersects() 2024-11-14 22:43:52 +11:00
tools powerpc/ftrace: Fix ftrace bug with KASAN=y 2024-11-10 22:33:51 +11:00
xmon powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
Kbuild powerpc64/ftrace: Move ftrace sequence out of line 2024-10-31 11:00:54 +11:00
Kconfig powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
Kconfig.debug powerpc/64: Remove maple platform 2024-10-29 23:01:52 +11:00
Makefile Kbuild updates for v6.13 2024-11-30 13:41:50 -08:00
Makefile.postlink powerpc/ftrace: Add a postlink script to validate function tracer 2024-10-31 11:00:54 +11:00