| 12523 | } |
| 12524 | |
| 12525 | Totals RunContext::runTest(TestCase const& testCase) { |
| 12526 | Totals prevTotals = m_totals; |
| 12527 | |
| 12528 | std::string redirectedCout; |
| 12529 | std::string redirectedCerr; |
| 12530 | |
| 12531 | auto const& testInfo = testCase.getTestCaseInfo(); |
| 12532 | |
| 12533 | m_reporter->testCaseStarting(testInfo); |
| 12534 | |
| 12535 | m_activeTestCase = &testCase; |
| 12536 | |
| 12537 | ITracker& rootTracker = m_trackerContext.startRun(); |
| 12538 | assert(rootTracker.isSectionTracker()); |
| 12539 | static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun()); |
| 12540 | do { |
| 12541 | m_trackerContext.startCycle(); |
| 12542 | m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo)); |
| 12543 | runCurrentTest(redirectedCout, redirectedCerr); |
| 12544 | } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); |
| 12545 | |
| 12546 | Totals deltaTotals = m_totals.delta(prevTotals); |
| 12547 | if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) { |
| 12548 | deltaTotals.assertions.failed++; |
| 12549 | deltaTotals.testCases.passed--; |
| 12550 | deltaTotals.testCases.failed++; |
| 12551 | } |
| 12552 | m_totals.testCases += deltaTotals.testCases; |
| 12553 | m_reporter->testCaseEnded(TestCaseStats(testInfo, |
| 12554 | deltaTotals, |
| 12555 | redirectedCout, |
| 12556 | redirectedCerr, |
| 12557 | aborting())); |
| 12558 | |
| 12559 | m_activeTestCase = nullptr; |
| 12560 | m_testCaseTracker = nullptr; |
| 12561 | |
| 12562 | return deltaTotals; |
| 12563 | } |
| 12564 | |
| 12565 | IConfigPtr RunContext::config() const { |
| 12566 | return m_config; |
no test coverage detected