| 214 | } |
| 215 | |
| 216 | void JUnitTestOutput::writeTestCases() |
| 217 | { |
| 218 | JUnitTestCaseResultNode* cur = impl_->results_.head_; |
| 219 | |
| 220 | while (cur) { |
| 221 | SimpleString buf = StringFromFormat( |
| 222 | "<testcase classname=\"%s%s%s\" name=\"%s\" assertions=\"%d\" time=\"%d.%03d\" file=\"%s\" line=\"%d\">\n", |
| 223 | impl_->package_.asCharString(), |
| 224 | impl_->package_.isEmpty() ? "" : ".", |
| 225 | impl_->results_.group_.asCharString(), |
| 226 | cur->name_.asCharString(), |
| 227 | (int) (cur->checkCount_ - impl_->results_.totalCheckCount_), |
| 228 | (int) (cur->execTime_ / 1000), (int)(cur->execTime_ % 1000), |
| 229 | cur->file_.asCharString(), |
| 230 | (int) cur->lineNumber_); |
| 231 | writeToFile(buf.asCharString()); |
| 232 | |
| 233 | impl_->results_.totalCheckCount_ = cur->checkCount_; |
| 234 | |
| 235 | if (cur->failure_) { |
| 236 | writeFailure(cur); |
| 237 | } |
| 238 | else if (cur->ignored_) { |
| 239 | writeToFile("<skipped />\n"); |
| 240 | } |
| 241 | writeToFile("</testcase>\n"); |
| 242 | cur = cur->next_; |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | void JUnitTestOutput::writeFailure(JUnitTestCaseResultNode* node) |
| 247 | { |
nothing calls this directly
no test coverage detected