aboutsummaryrefslogtreecommitdiff
path: root/tests/common/test.h
blob: f819ad8e0fe9409ba71cb85e3a3d95e92f2e3658 (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
#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 fail(x, ...)\
	printf("FAIL: " x, ## __VA_ARGS__)

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

#define ok()\
	printf("OK\n");\
	sys_poweroff(SYS_SHUTDOWN)

#endif /* KMI_TESTS_H */