aboutsummaryrefslogtreecommitdiff
path: root/sys/tests
diff options
context:
space:
mode:
authorNick Banks <nickbanks@netflix.com>2025-10-13 20:31:30 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2025-10-13 20:31:30 +0000
commitbfdd5b643d23171c53920accc2f15f78e984dfae (patch)
tree649a09f27a11a30fc83a355f83b2e035b56d4480 /sys/tests
parent0eef2b4a002aace2ac9cc092bee6e10f6332f5ce (diff)
Diffstat (limited to 'sys/tests')
-rw-r--r--sys/tests/ktest.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/tests/ktest.h b/sys/tests/ktest.h
index 8af92f1e0c18..75d7a75e2fff 100644
--- a/sys/tests/ktest.h
+++ b/sys/tests/ktest.h
@@ -57,6 +57,8 @@ struct ktest_test_info {
ktest_parse_t parse;
};
+#define KTEST_FUNC(X) static int __ktest_##X(struct ktest_test_context *ctx)
+
struct ktest_module_info {
const char *name;
const struct ktest_test_info *tests;
@@ -64,6 +66,8 @@ struct ktest_module_info {
void *module_ptr;
};
+#define KTEST_INFO(X) { "test_" #X, "Test " #X, __ktest_##X, NULL }
+
int ktest_default_modevent(module_t mod, int type, void *arg);
bool ktest_start_msg(struct ktest_test_context *ctx);
@@ -84,6 +88,9 @@ void ktest_end_msg(struct ktest_test_context *ctx);
#define KTEST_LOG(_ctx, _fmt, ...) \
KTEST_LOG_LEVEL(_ctx, LOG_DEBUG, _fmt, ## __VA_ARGS__)
+#define KTEST_ERR(_ctx, _fmt, ...) \
+ KTEST_LOG_LEVEL(_ctx, LOG_ERR, _fmt, ## __VA_ARGS__)
+
#define KTEST_MAX_BUF 512
#define KTEST_MODULE_DECLARE(_n, _t) \