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.
Dependents: mtsas mtsas mtsas mtsas ... more
TestRunner.h@1:42d2b6980cdd, 2014-05-19 (annotated)
- Committer:
- Mike Fiore
- Date:
- Mon May 19 11:02:48 2014 -0500
- Revision:
- 1:42d2b6980cdd
- Parent:
- 0:e002468be03b
- Child:
- 11:0930606c0186
add test infrastructure and main function
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mfiore | 0:e002468be03b | 1 | #ifndef TESTRUNNER_H |
| mfiore | 0:e002468be03b | 2 | #define TESTRUNNER_H |
| mfiore | 0:e002468be03b | 3 | |
| Mike Fiore |
1:42d2b6980cdd | 4 | #include <vector> |
| Mike Fiore |
1:42d2b6980cdd | 5 | |
| Mike Fiore |
1:42d2b6980cdd | 6 | #include "TestCollection.h" |
| Mike Fiore |
1:42d2b6980cdd | 7 | #include "Test.h" |
| Mike Fiore |
1:42d2b6980cdd | 8 | |
| Mike Fiore |
1:42d2b6980cdd | 9 | namespace mts |
| Mike Fiore |
1:42d2b6980cdd | 10 | { |
| Mike Fiore |
1:42d2b6980cdd | 11 | |
| Mike Fiore |
1:42d2b6980cdd | 12 | /** |
| Mike Fiore |
1:42d2b6980cdd | 13 | * |
| Mike Fiore |
1:42d2b6980cdd | 14 | */ |
| Mike Fiore |
1:42d2b6980cdd | 15 | class TestRunner |
| Mike Fiore |
1:42d2b6980cdd | 16 | { |
| Mike Fiore |
1:42d2b6980cdd | 17 | public: |
| Mike Fiore |
1:42d2b6980cdd | 18 | /** |
| Mike Fiore |
1:42d2b6980cdd | 19 | * |
| Mike Fiore |
1:42d2b6980cdd | 20 | */ |
| Mike Fiore |
1:42d2b6980cdd | 21 | static void addCollection(TestCollection* collection); |
| Mike Fiore |
1:42d2b6980cdd | 22 | |
| Mike Fiore |
1:42d2b6980cdd | 23 | /** |
| Mike Fiore |
1:42d2b6980cdd | 24 | * |
| Mike Fiore |
1:42d2b6980cdd | 25 | */ |
| Mike Fiore |
1:42d2b6980cdd | 26 | static void clearCollections(); |
| Mike Fiore |
1:42d2b6980cdd | 27 | |
| Mike Fiore |
1:42d2b6980cdd | 28 | /** |
| Mike Fiore |
1:42d2b6980cdd | 29 | * |
| Mike Fiore |
1:42d2b6980cdd | 30 | */ |
| Mike Fiore |
1:42d2b6980cdd | 31 | static void runTests(bool printPassedTests = false, bool printFailedTests = true, bool printPassedCollections = true, bool printFailedCollections = true); |
| Mike Fiore |
1:42d2b6980cdd | 32 | |
| Mike Fiore |
1:42d2b6980cdd | 33 | private: |
| Mike Fiore |
1:42d2b6980cdd | 34 | static std::vector<TestCollection*> collections; |
| Mike Fiore |
1:42d2b6980cdd | 35 | static int totalCollections; |
| Mike Fiore |
1:42d2b6980cdd | 36 | static int collectionsFailed; |
| Mike Fiore |
1:42d2b6980cdd | 37 | static int totalTests; |
| Mike Fiore |
1:42d2b6980cdd | 38 | static int totalFailed; |
| Mike Fiore |
1:42d2b6980cdd | 39 | }; |
| Mike Fiore |
1:42d2b6980cdd | 40 | |
| Mike Fiore |
1:42d2b6980cdd | 41 | } |
| Mike Fiore |
1:42d2b6980cdd | 42 | |
| Mike Fiore |
1:42d2b6980cdd | 43 | #endif |