aboutsummaryrefslogtreecommitdiffstats
path: root/lib/string_helpers_kunit.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: Move KUnit tests into tests/ subdirectoryKees Cook2025-02-111-629/+0
| | | | | | | | | | | | | | | Following from the recent KUnit file naming discussion[1], move all KUnit tests in lib/ into lib/tests/. Link: https://lore.kernel.org/lkml/[email protected]/ [1] Acked-by: Steven Rostedt (Google) <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Reviewed-by: David Gow <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Reviewed-by: Rae Moar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
* string: kunit: add missing MODULE_DESCRIPTION() macrosJeff Johnson2024-06-281-0/+1
| | | | | | | | | | | | make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in lib/string_kunit.o WARNING: modpost: missing MODULE_DESCRIPTION() in lib/string_helpers_kunit.o Add the missing invocation of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
* string: Convert helpers selftest to KUnitKees Cook2024-03-051-0/+628
Convert test-string_helpers.c to KUnit so it can be easily run with everything else. Failure reporting doesn't need to be open-coded in most places, for example, forcing a failure in the expected output for upper/lower testing looks like this: [12:18:43] # test_upper_lower: EXPECTATION FAILED at lib/string_helpers_kunit.c:579 [12:18:43] Expected dst == strings_upper[i].out, but [12:18:43] dst == "ABCDEFGH1234567890TEST" [12:18:43] strings_upper[i].out == "ABCDEFGH1234567890TeST" [12:18:43] [FAILED] test_upper_lower Currently passes without problems: $ ./tools/testing/kunit/kunit.py run string_helpers ... [12:23:55] Starting KUnit Kernel (1/1)... [12:23:55] ============================================================ [12:23:55] =============== string_helpers (3 subtests) ================ [12:23:55] [PASSED] test_get_size [12:23:55] [PASSED] test_upper_lower [12:23:55] [PASSED] test_unescape [12:23:55] ================= [PASSED] string_helpers ================== [12:23:55] ============================================================ [12:23:55] Testing complete. Ran 3 tests: passed: 3 [12:23:55] Elapsed time: 6.709s total, 0.001s configuring, 6.591s building, 0.066s running Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>