kunit: add debugfs /sys/kernel/debug/kunit/<suite>/results display
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@oracle.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Reviewed-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
30
lib/kunit/debugfs.h
Normal file
30
lib/kunit/debugfs.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2020, Oracle and/or its affiliates.
|
||||
*/
|
||||
|
||||
#ifndef _KUNIT_DEBUGFS_H
|
||||
#define _KUNIT_DEBUGFS_H
|
||||
|
||||
#include <kunit/test.h>
|
||||
|
||||
#ifdef CONFIG_KUNIT_DEBUGFS
|
||||
|
||||
void kunit_debugfs_create_suite(struct kunit_suite *suite);
|
||||
void kunit_debugfs_destroy_suite(struct kunit_suite *suite);
|
||||
void kunit_debugfs_init(void);
|
||||
void kunit_debugfs_cleanup(void);
|
||||
|
||||
#else
|
||||
|
||||
static inline void kunit_debugfs_create_suite(struct kunit_suite *suite) { }
|
||||
|
||||
static inline void kunit_debugfs_destroy_suite(struct kunit_suite *suite) { }
|
||||
|
||||
static inline void kunit_debugfs_init(void) { }
|
||||
|
||||
static inline void kunit_debugfs_cleanup(void) { }
|
||||
|
||||
#endif /* CONFIG_KUNIT_DEBUGFS */
|
||||
|
||||
#endif /* _KUNIT_DEBUGFS_H */
|
Reference in New Issue
Block a user