1*538aa54dSGarrett D'Amore /*
2*538aa54dSGarrett D'Amore  * This file and its contents are supplied under the terms of the
3*538aa54dSGarrett D'Amore  * Common Development and Distribution License ("CDDL"), version 1.0.
4*538aa54dSGarrett D'Amore  * You may only use this file in accordance with the terms of version
5*538aa54dSGarrett D'Amore  * 1.0 of the CDDL.
6*538aa54dSGarrett D'Amore  *
7*538aa54dSGarrett D'Amore  * A full copy of the text of the CDDL should have accompanied this
8*538aa54dSGarrett D'Amore  * source.  A copy of the CDDL is also available via the Internet at
9*538aa54dSGarrett D'Amore  * http://www.illumos.org/license/CDDL.
10*538aa54dSGarrett D'Amore  */
11*538aa54dSGarrett D'Amore 
12*538aa54dSGarrett D'Amore /*
13*538aa54dSGarrett D'Amore  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
14*538aa54dSGarrett D'Amore  */
15*538aa54dSGarrett D'Amore 
16*538aa54dSGarrett D'Amore /*
17*538aa54dSGarrett D'Amore  * Common handling for test programs.
18*538aa54dSGarrett D'Amore  */
19*538aa54dSGarrett D'Amore 
20*538aa54dSGarrett D'Amore #ifndef	_TEST_COMMON_H
21*538aa54dSGarrett D'Amore #define	_TEST_COMMON_H
22*538aa54dSGarrett D'Amore 
23*538aa54dSGarrett D'Amore #ifdef	__cplusplus
24*538aa54dSGarrett D'Amore extern "C" {
25*538aa54dSGarrett D'Amore #endif
26*538aa54dSGarrett D'Amore 
27*538aa54dSGarrett D'Amore typedef struct test *test_t;
28*538aa54dSGarrett D'Amore typedef void (*test_func_t)(test_t, void *);
29*538aa54dSGarrett D'Amore 
30*538aa54dSGarrett D'Amore extern void test_set_debug(void);
31*538aa54dSGarrett D'Amore extern void test_set_force(void);
32*538aa54dSGarrett D'Amore extern test_t test_start(const char *name, ...);
33*538aa54dSGarrett D'Amore extern void test_failed(test_t, const char *format, ...);
34*538aa54dSGarrett D'Amore extern void test_passed(test_t);
35*538aa54dSGarrett D'Amore extern void test_debugf(test_t, const char *format, ...);
36*538aa54dSGarrett D'Amore extern void test_run(int nthr, test_func_t, void *arg, const char *, ...);
37*538aa54dSGarrett D'Amore 
38*538aa54dSGarrett D'Amore #ifdef	__cplusplus
39*538aa54dSGarrett D'Amore }
40*538aa54dSGarrett D'Amore #endif
41*538aa54dSGarrett D'Amore #endif	/* _TEST_COMMON_H */
42