aboutsummaryrefslogtreecommitdiff
path: root/tests/common/test.h
blob: 1476fdf2ab02c1f7f008d0c47c1537bfb2e35b22 (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
#ifndef KMI_TESTS_H
#define KMI_TESTS_H

#include <kmi/attrs.h>
#include <kmi/types.h>

#include "sys.h"
#include "start.h"
#include "printf.h"

#define error(x, ...)\
	printf("ERROR: " x, ## __VA_ARGS__)

#define check(x, y, ...)\
	if (!(x)) {\
		error(y, ##__VA_ARGS__);\
		sys_poweroff(SYS_SHUTDOWN);\
	}

static inline void ok() {
	printf("OK\n");
	sys_poweroff(SYS_SHUTDOWN);
}

#endif /* KMI_TESTS_H */