zhangxinyu01text

Dependencies:   mbed

Revision:
10:167d0aa1c9b3
Parent:
6:d9d05b321b4d
Child:
12:3952ba0683c7
diff -r d9d05b321b4d -r 167d0aa1c9b3 main.cpp
--- a/main.cpp	Wed Feb 21 10:04:46 2018 +0000
+++ b/main.cpp	Mon Apr 16 18:08:05 2018 +0000
@@ -4,6 +4,10 @@
 #include "N5110.h"
 #include "PongEngine.h"
 
+#ifdef WITH_TESTING
+# include "tests.h"
+#endif
+
 #define PADDLE_WIDTH 2
 #define PADDLE_HEIGHT 8
 #define BALL_SIZE 2
@@ -28,6 +32,12 @@
 ///////////// functions ////////////////
 int main()
 {
+#ifdef WITH_TESTING
+    int number_of_failures = run_all_tests();
+
+    if(number_of_failures > 0) return number_of_failures;
+#endif
+
     int fps = 8;  // frames per second
 
     init();     // initialise and then display welcome screen...