add debugfs support for displaying kunit test suite results; this is
especially useful for module-loaded tests to allow disentangling of
test result display from other dmesg events. debugfs support is
provided if CONFIG_KUNIT_DEBUGFS=y.
As well as printk()ing messages, we append them to a per-test log.
Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
Reviewed-by: Brendan Higgins <brendanhiggins@xxxxxxxxxx>
Reviewed-by: Frank Rowand <frank.rowand@xxxxxxxx>
---
include/kunit/test.h | 54 +++++++++++++++---
lib/kunit/Kconfig | 8 +++
lib/kunit/Makefile | 4 ++
lib/kunit/debugfs.c | 116 ++++++++++++++++++++++++++++++++++++++
lib/kunit/debugfs.h | 30 ++++++++++
lib/kunit/kunit-test.c | 4 +-
lib/kunit/test.c | 147 ++++++++++++++++++++++++++++++++++++++-----------
7 files changed, 322 insertions(+), 41 deletions(-)
create mode 100644 lib/kunit/debugfs.c
create mode 100644 lib/kunit/debugfs.h
diff --git a/lib/kunit/Kconfig b/lib/kunit/Kconfig
index 065aa16..95d12e3 100644
--- a/lib/kunit/Kconfig
+++ b/lib/kunit/Kconfig
@@ -14,6 +14,14 @@ menuconfig KUNIT
if KUNIT
+config KUNIT_DEBUGFS
+ bool "KUnit - Enable /sys/kernel/debug/kunit debugfs representation"
+ help
+ Enable debugfs representation for kunit. Currently this consists
+ of /sys/kernel/debug/kunit/<test_suite>/results files for each
+ test suite, which allow users to see results of the last test suite
+ run that occurred.
+