| 8536 | } |
| 8537 | |
| 8538 | Totals RunContext::runTest(TestCase const &testCase) { |
| 8539 | Totals prevTotals = m_totals; |
| 8540 | |
| 8541 | std::string redirectedCout; |
| 8542 | std::string redirectedCerr; |
| 8543 | |
| 8544 | auto const &testInfo = testCase.getTestCaseInfo(); |
| 8545 | |
| 8546 | m_reporter->testCaseStarting(testInfo); |
| 8547 | |
| 8548 | m_activeTestCase = &testCase; |
| 8549 | |
| 8550 | ITracker &rootTracker = m_trackerContext.startRun(); |
| 8551 | assert(rootTracker.isSectionTracker()); |
| 8552 | static_cast<SectionTracker &>(rootTracker).addInitialFilters(m_config->getSectionsToRun()); |
| 8553 | do { |
| 8554 | m_trackerContext.startCycle(); |
| 8555 | m_testCaseTracker = |
| 8556 | &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo)); |
| 8557 | runCurrentTest(redirectedCout, redirectedCerr); |
| 8558 | } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); |
| 8559 | |
| 8560 | Totals deltaTotals = m_totals.delta(prevTotals); |
| 8561 | if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) { |
| 8562 | deltaTotals.assertions.failed++; |
| 8563 | deltaTotals.testCases.passed--; |
| 8564 | deltaTotals.testCases.failed++; |
| 8565 | } |
| 8566 | m_totals.testCases += deltaTotals.testCases; |
| 8567 | m_reporter->testCaseEnded(TestCaseStats(testInfo, deltaTotals, redirectedCout, redirectedCerr, aborting())); |
| 8568 | |
| 8569 | m_activeTestCase = nullptr; |
| 8570 | m_testCaseTracker = nullptr; |
| 8571 | |
| 8572 | return deltaTotals; |
| 8573 | } |
| 8574 | |
| 8575 | IConfigPtr RunContext::config() const { |
| 8576 | return m_config; |
no test coverage detected