* support/regression/fwk/include/testfwk.h: Fixed up to use function pts correctly.
[fw/sdcc] / support / regression / fwk / include / testfwk.h
1 #ifndef __TESTFWK_H
2 #define __TESTFWK_H 1
3
4 extern int __numTests;
5
6 void __fail(const char *szMsg, const char *szCond, const char *szFile, int line);
7 void __printf(const char *szFormat, ...) REENTRANT;
8
9 #define ASSERT(_a)      (__numTests++, (_a) ? (void)0 : __fail("Assertion failed", #_a, __FILE__, __LINE__))
10 #define LOG(_a)         __printf _a
11 #define FAIL()          FAILM("Failure")
12 #define FAILM(_a)       __fail(_a, #_a, __FILE__, __LINE__)
13
14 typedef void (*TESTFUNP)(void);
15
16 // Provided by the suite
17 TESTFUNP *
18 suite(void);
19
20 const char *
21 getSuiteName(void);
22
23 #define NULL    0
24
25 #define UNUSED(_a)      if (_a) { }
26
27 #endif