xref: /illumos-gate/usr/src/lib/libktest/common/libktest_impl.h (revision 2a838cdeeca0eef6fcf8eaa3df95be38375b4af7)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2025 Oxide Computer Company
14  */
15 
16 #ifndef _LIBKTEST_IMPL_H
17 #define	_LIBKTEST_IMPL_H
18 
19 #include <sys/ktest.h>
20 #include <libktest.h>
21 #include <sys/debug.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define	KTEST_DEV_PATH		"/dev/ktest"
28 
29 struct ktest_hdl {
30 	int	kt_fd;
31 };
32 
33 struct ktest_list_iter {
34 	ktest_hdl_t	*kli_hdl;
35 
36 	nvlist_t	*kli_modules;
37 	nvpair_t	*kli_module;
38 	nvlist_t	*kli_suites;
39 	nvpair_t	*kli_suite;
40 	nvlist_t	*kli_tests;
41 	nvpair_t	*kli_test;
42 	boolean_t	kli_req_input;
43 };
44 
45 CTASSERT((int)KTEST_CODE_NONE == (int)KTEST_RESULT_NONE);
46 CTASSERT((int)KTEST_CODE_PASS == (int)KTEST_RESULT_PASS);
47 CTASSERT((int)KTEST_CODE_FAIL == (int)KTEST_RESULT_FAIL);
48 CTASSERT((int)KTEST_CODE_SKIP == (int)KTEST_RESULT_SKIP);
49 CTASSERT((int)KTEST_CODE_ERROR == (int)KTEST_RESULT_ERROR);
50 
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif /* _LIBKTEST_IMPL_H */
57