| 270 | } |
| 271 | |
| 272 | bool Runner::runAllTest(bool printSummary) const { |
| 273 | unsigned int count = testCount(); |
| 274 | std::deque<TestResult> failures; |
| 275 | for (unsigned int index = 0; index < count; ++index) { |
| 276 | TestResult result; |
| 277 | runTestAt(index, result); |
| 278 | if (result.failed()) { |
| 279 | failures.push_back(result); |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | if (failures.empty()) { |
| 284 | if (printSummary) { |
| 285 | printf("All %d tests passed\n", count); |
| 286 | } |
| 287 | return true; |
| 288 | } else { |
| 289 | for (unsigned int index = 0; index < failures.size(); ++index) { |
| 290 | TestResult& result = failures[index]; |
| 291 | result.printFailure(count > 1); |
| 292 | } |
| 293 | |
| 294 | if (printSummary) { |
| 295 | unsigned int failedCount = static_cast<unsigned int>(failures.size()); |
| 296 | unsigned int passedCount = count - failedCount; |
| 297 | printf("%d/%d tests passed (%d failure(s))\n", |
| 298 | passedCount, |
| 299 | count, |
| 300 | failedCount); |
| 301 | } |
| 302 | return false; |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | bool Runner::testIndex(const JSONCPP_STRING& testName, |
| 307 | unsigned int& indexOut) const { |
no test coverage detected