Add test macros, useful to compile a test as a single file.
[bertos.git] / bertos / drv / timer_test.c
index 5fc4257041924542cada51f8a521a3b07933f264..f30ac45e2accebc7f806bd881374b985b3cf8b8a 100644 (file)
@@ -33,7 +33,7 @@
  * \brief Hardware independent timer driver (implementation)
  *
  * \version $Id$
- * \author Bernardo Innocenti <bernie@develer.com>
+ * \author Bernie Innocenti <bernie@codewiz.org>
  */
 
 #include <cfg/test.h>
 
 #include <mware/event.h>
 
+#include <cfg/debug.h>
+
+#warning TODO:Refactor this test to comply whit BeRTOS test policy.
+
+#ifdef _TEST
 
 static void timer_test_constants(void)
 {
@@ -65,7 +70,7 @@ static void timer_test_constants(void)
        kprintf("ticks_to_us(100)=%lu\n", ticks_to_us(100));
        kprintf("ticks_to_us(10000)=%lu\n", ticks_to_us(10000));
        kprintf("\n");
-       kprintf("hptime_to_us(100)=%lu\n", hptime_to_us(100));
+       kprintf("hptime_to_us(100)=%ld\n", hptime_to_us(100));
        kprintf("hptime_to_us(10000)=%lu\n", hptime_to_us(10000));
        kprintf("us_to_hptime(100)=%lu\n", us_to_hptime(100));
        kprintf("us_to_hptime(10000)=%lu\n", us_to_hptime(10000));
@@ -126,11 +131,6 @@ static void timer_test_poll(void)
        }
 }
 
-#ifdef _TEST
-
-#include "timer.c"
-#include "mware/event.c"
-#include "os/hptime.c"
 
 int main(void)
 {
@@ -142,5 +142,13 @@ int main(void)
        timer_test_poll();
        return 0;
 }
+
+#include "timer.c"
+#include "drv/kdebug.c"
+#include "mware/event.c"
+#include "mware/formatwr.c"
+#include "mware/hex.c"
+#include "os/hptime.c"
+
 #endif