168
|
1 |
#ifndef TEST_TEST_H
|
|
2 |
#define TEST_TEST_H
|
|
3 |
|
|
4 |
/**
|
|
5 |
* @file
|
|
6 |
*
|
|
7 |
* General test-related functionality
|
|
8 |
*/
|
|
9 |
#include "assert.h"
|
|
10 |
#include "util.h"
|
|
11 |
|
|
12 |
#include <event2/event.h>
|
|
13 |
#include <string.h>
|
|
14 |
|
|
15 |
/**
|
|
16 |
* Global test-running state
|
|
17 |
*/
|
|
18 |
extern struct test_ctx {
|
|
19 |
/** The event_base that we have setup */
|
|
20 |
struct event_base *ev_base;
|
|
21 |
|
|
22 |
} _test_ctx;
|
|
23 |
|
|
24 |
|
|
25 |
/**
|
|
26 |
* Global list of test definitions
|
|
27 |
*/
|
|
28 |
extern const struct test {
|
|
29 |
/** Test name */
|
|
30 |
const char *name;
|
|
31 |
|
|
32 |
/** Test func */
|
|
33 |
void (*func) (void);
|
|
34 |
|
|
35 |
/** Do not run by default */
|
|
36 |
bool optional;
|
|
37 |
} _tests[];
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
#endif
|