#if defined(ARCH_UNITTEST) && (ARCH & ARCH_UNITTEST)
#define UNIT_TEST 1
+
+ /**
+ * Macro used to generate a main() for a test to be compiled
+ * on hosted platform.
+ */
+ #define TEST_MAIN(module) \
+ int main(void) \
+ { \
+ if (module##_testSetup() != 0) \
+ return 1; \
+ if (module##_testRun() != 0) \
+ return 2; \
+ if (module##_testTearDown() != 0) \
+ return 3; \
+ return 0; \
+ }
#else /* !TEST */
#define UNIT_TEST 0
+
+ #define TEST_MAIN(module) /* nothing */
#endif /* TEST */
-/**
- * Macro used to generate a main() for a test to be compiled
- * on hosted platform.
- */
-#define TEST_MAIN(module) \
-int main(void) \
-{ \
- if (module##_testSetup() != 0) \
- return 1; \
- if (module##_testRun() != 0) \
- return 2; \
- if (module##_testTearDown() != 0) \
- return 3; \
- return 0; \
-}
/**
* Silent an assert in a test.
return 0;
}
-#if UNIT_TEST
int proc_testSetup(void)
{
return 0;
}
-#include <drv/kdebug.c>
-#include <drv/timer.c>
-#include <kern/idle.c>
-#include <kern/monitor.c>
-#include <kern/signal.c>
-#if CONFIG_KERN_PREEMPT
- #include <kern/preempt.c>
- #include <kern/irq.c>
-#else
- #include <kern/coop.c>
- // FIXME: we need to link with the switch asm code too!
-#endif
-#include <kern/proc.c>
-#include <mware/formatwr.c>
-#include <mware/hex.c>
-#include <mware/event.c>
-#include <os/hptime.c>
-
TEST_MAIN(proc);
-
-#endif // _TEST