Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 10:167d0aa1c9b3
- Parent:
- 6:d9d05b321b4d
- Child:
- 12:2af7b4868033
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...