| 150 | } |
| 151 | |
| 152 | class JUnitTestOutputTestRunner |
| 153 | { |
| 154 | TestResult result_; |
| 155 | |
| 156 | const char* currentGroupName_; |
| 157 | UtestShell* currentTest_; |
| 158 | bool firstTestInGroup_; |
| 159 | int timeTheTestTakes_; |
| 160 | unsigned int numberOfChecksInTest_; |
| 161 | TestFailure* testFailure_; |
| 162 | |
| 163 | public: |
| 164 | |
| 165 | explicit JUnitTestOutputTestRunner(const TestResult& result) : |
| 166 | result_(result), currentGroupName_(NULLPTR), currentTest_(NULLPTR), firstTestInGroup_(true), timeTheTestTakes_(0), numberOfChecksInTest_(0), testFailure_(NULLPTR) |
| 167 | { |
| 168 | millisTime = 0; |
| 169 | theTime = "1978-10-03T00:00:00"; |
| 170 | |
| 171 | UT_PTR_SET(GetPlatformSpecificTimeInMillis, MockGetPlatformSpecificTimeInMillis); |
| 172 | UT_PTR_SET(GetPlatformSpecificTimeString, MockGetPlatformSpecificTimeString); |
| 173 | } |
| 174 | |
| 175 | JUnitTestOutputTestRunner& start() |
| 176 | { |
| 177 | result_.testsStarted(); |
| 178 | return *this; |
| 179 | } |
| 180 | |
| 181 | JUnitTestOutputTestRunner& end() |
| 182 | { |
| 183 | endOfPreviousTestGroup(); |
| 184 | delete currentTest_; |
| 185 | result_.testsEnded(); |
| 186 | return *this; |
| 187 | } |
| 188 | |
| 189 | JUnitTestOutputTestRunner& endGroupAndClearTest() |
| 190 | { |
| 191 | endOfPreviousTestGroup(); |
| 192 | delete currentTest_; |
| 193 | currentTest_ = NULLPTR; |
| 194 | return *this; |
| 195 | } |
| 196 | |
| 197 | void endOfPreviousTestGroup() |
| 198 | { |
| 199 | runPreviousTest(); |
| 200 | if (currentTest_) { |
| 201 | result_.currentGroupEnded(currentTest_); |
| 202 | firstTestInGroup_ = true; |
| 203 | } |
| 204 | |
| 205 | currentGroupName_ = NULLPTR; |
| 206 | } |
| 207 | |
| 208 | JUnitTestOutputTestRunner& withGroup(const char* groupName) |
| 209 | { |
nothing calls this directly
no test coverage detected