test.h

Go to the documentation of this file.
00001 
00073 #ifndef CFG_TEST_H
00074 #define CFG_TEST_H
00075 
00076 #include "cfg/cfg_arch.h"
00077 
00078 #if defined(ARCH_UNITTEST) && (ARCH & ARCH_UNITTEST)
00079     #define UNIT_TEST 1
00080 
00085     #define TEST_MAIN(module) \
00086     int main(void) \
00087     { \
00088         if (module##_testSetup() != 0) \
00089             return 1; \
00090         if (module##_testRun() != 0) \
00091             return 2; \
00092         if (module##_testTearDown() != 0) \
00093             return 3; \
00094         return 0; \
00095     }
00096 #else /* !TEST */
00097     #define UNIT_TEST 0
00098 
00099     #define TEST_MAIN(module) /* nothing */
00100 #endif /* TEST */
00101 
00102 
00116 #define SILENT_ASSERT(str) kputs("SILENT_ASSERT:$"str"$\n")
00117 
00118 #endif /* CFG_TEST_H */