Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
TestManager.cpp@2:ea883307d02f, 2012-08-22 (annotated)
- Committer:
- ashleymills
- Date:
- Wed Aug 22 13:27:34 2012 +0000
- Revision:
- 2:ea883307d02f
- Child:
- 3:28336c2e94e4
Added TestManager class and LogHeader
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashleymills | 2:ea883307d02f | 1 | #include "TestManager.h" |
ashleymills | 2:ea883307d02f | 2 | #include "ExampleTest.h" |
ashleymills | 2:ea883307d02f | 3 | TestManager::TestManager(VodafoneUSBModem *m) : _modem(m) { |
ashleymills | 2:ea883307d02f | 4 | _tests.push_back((VodafoneTestCase*)new ExampleTest(_modem)); |
ashleymills | 2:ea883307d02f | 5 | } |
ashleymills | 2:ea883307d02f | 6 | |
ashleymills | 2:ea883307d02f | 7 | int TestManager::runAll() { |
ashleymills | 2:ea883307d02f | 8 | int successfullTests = 0; |
ashleymills | 2:ea883307d02f | 9 | LOG("Running %d tests...",_tests.size()); |
ashleymills | 2:ea883307d02f | 10 | for(int i=0; i<_tests.size(); i++) { |
ashleymills | 2:ea883307d02f | 11 | LOG("Running test %d...",i); |
ashleymills | 2:ea883307d02f | 12 | if(_tests[i]->runTest()) { |
ashleymills | 2:ea883307d02f | 13 | LOG("...OK"); |
ashleymills | 2:ea883307d02f | 14 | successfullTests++; |
ashleymills | 2:ea883307d02f | 15 | } else { |
ashleymills | 2:ea883307d02f | 16 | LOG("...FAIL"); |
ashleymills | 2:ea883307d02f | 17 | } |
ashleymills | 2:ea883307d02f | 18 | } |
ashleymills | 2:ea883307d02f | 19 | return successfullTests; |
ashleymills | 2:ea883307d02f | 20 | } |
ashleymills | 2:ea883307d02f | 21 | |
ashleymills | 2:ea883307d02f | 22 | int TestManager::getNumTests() { |
ashleymills | 2:ea883307d02f | 23 | return _tests.size(); |
ashleymills | 2:ea883307d02f | 24 | } |