ELEC2645 (2017/18) / Mbed 2 deprecated fy15raf

Dependencies:   mbed

Revision:
13:00bbb0612e97
Parent:
12:4d7f1349d796
Child:
14:cf4a32245152
--- a/main.cpp	Fri May 04 21:19:34 2018 +0000
+++ b/main.cpp	Fri May 04 23:26:17 2018 +0000
@@ -14,7 +14,7 @@
 #include "Gamepad.h"
 #include "N5110.h"
 #include "GameEngine.h"
-
+#include "tests.h"
 /////////////// objects ///////////////
 N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
 Gamepad g_pad;
@@ -29,6 +29,13 @@
 ///////////// functions ////////////////
 int main()
 {
+    //game will excute if all tests passed
+    #ifdef ALL_TESTS_H
+    int failures = Run_tests();
+
+    if(failures > 0) return failures;
+    #endif
+    
     int fps = 8;  // frames per second
     int sleep=0;
     init();     // initialise