blob: 6b74ff007e776e33c74f1e454bceb84573d6c805 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#ifndef _IPXE_TEST_H
#define _IPXE_TEST_H
FILE_LICENCE ( GPL2_OR_LATER );
/** @file
*
* Self-test infrastructure
*
*/
#include <ipxe/tables.h>
/** A self-test set */
struct self_test {
/** Test set name */
const char *name;
/** Run self-tests */
void ( * exec ) ( void );
/** Number of tests run */
unsigned int total;
/** Number of test failures */
unsigned int failures;
/** Number of assertion failures */
unsigned int assertion_failures;
};
/** Self-test table */
#define SELF_TESTS __table ( struct self_test, "self_tests" )
/** Declare a self-test */
#define __self_test __table_entry ( SELF_TESTS, 01 )
extern void test_ok ( int success, const char *file, unsigned int line,
const char *test );
/**
* Report test result
*
* @v success Test succeeded
*/
#define ok( success ) do { \
test_ok ( (success), __FILE__, __LINE__, #success ); \
} while ( 0 )
#endif /* _IPXE_TEST_H */
|