unicode: kunit: refactor selftest to kunit tests
authorGabriela Bittencourt <gbittencourt@lkcamp.dev>
Mon, 2 Dec 2024 07:55:42 +0000 (15:55 +0800)
committerKees Cook <kees@kernel.org>
Tue, 11 Feb 2025 02:25:39 +0000 (18:25 -0800)
commit62b9ef504e7f89d6ae3e9ab704cc4befab1d37f0
treeb0a0239c2e5ef2e9aa5a7e859f9d182ae26228d6
parent4d557cb4998654441a1018a9f6550d59098c0c9d
unicode: kunit: refactor selftest to kunit tests

Refactoring 'test' functions into kunit tests, to test utf-8 support in
unicode subsystem.

This allows the utf8 tests to be run alongside the KUnit test suite
using kunit-tool, quickly compiling and running all desired tests as
part of the KUnit test suite, instead of compiling the selftest module
and loading it.

The refactoring kept the original testing logic intact, while adopting a
testing pattern across different kernel modules and leveraging KUnit's
benefits.

Co-developed-by: Pedro Orlando <porlando@lkcamp.dev>
Signed-off-by: Pedro Orlando <porlando@lkcamp.dev>
Co-developed-by: Danilo Pereira <dpereira@lkcamp.dev>
Signed-off-by: Danilo Pereira <dpereira@lkcamp.dev>
Signed-off-by: Gabriela Bittencourt <gbittencourt@lkcamp.dev>
Reviewed-by: David Gow <davidgow@google.com>
Acked-by: Gabriel Krisman Bertazi <krisman@suse.de>
Reviewed-by: Rae Moar <rmoar@google.com>
Link: https://lore.kernel.org/r/20241202075545.3648096-6-davidgow@google.com
Signed-off-by: Kees Cook <kees@kernel.org>
fs/unicode/.kunitconfig [new file with mode: 0644]
fs/unicode/Kconfig
fs/unicode/Makefile
fs/unicode/utf8-norm.c
fs/unicode/utf8-selftest.c