Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Diff: TestManager.cpp
- Revision:
- 4:1f8e079924ba
- Parent:
- 3:28336c2e94e4
- Child:
- 7:ec0db221f897
--- a/TestManager.cpp Thu Aug 23 13:32:32 2012 +0000 +++ b/TestManager.cpp Thu Aug 23 15:41:20 2012 +0000 @@ -10,7 +10,7 @@ LOG("Running %d tests...",_tests.size()); for(int i=0; i<_tests.size(); i++) { LOG("Running test %d...",i); - if(_tests[i]->runTest()) { + if(_tests[i]->run()) { LOG("...OK"); successfullTests++; } else { @@ -20,6 +20,22 @@ return successfullTests; } +bool TestManager::runTest(int id) { + if(id<0||id>=_tests.size()) { + LOG("Test ID must be between 0 and %d",_tests.size()); + } + return _tests[id]->run(); +} + + +bool TestManager::runTest(int id, int numTimes) { + for(int i=0; i<numTimes; i++) { + if(!runTest(id)) + return false; + } + return true; +} + int TestManager::getNumTests() { return _tests.size(); } \ No newline at end of file