| 12741 | } |
| 12742 | |
| 12743 | Totals RunContext::runTest(TestCase const& testCase) { |
| 12744 | Totals prevTotals = m_totals; |
| 12745 | |
| 12746 | std::string redirectedCout; |
| 12747 | std::string redirectedCerr; |
| 12748 | |
| 12749 | auto const& testInfo = testCase.getTestCaseInfo(); |
| 12750 | |
| 12751 | m_reporter->testCaseStarting(testInfo); |
| 12752 | |
| 12753 | m_activeTestCase = &testCase; |
| 12754 | |
| 12755 | ITracker& rootTracker = m_trackerContext.startRun(); |
| 12756 | assert(rootTracker.isSectionTracker()); |
| 12757 | static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun()); |
| 12758 | do { |
| 12759 | m_trackerContext.startCycle(); |
| 12760 | m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo)); |
| 12761 | runCurrentTest(redirectedCout, redirectedCerr); |
| 12762 | } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); |
| 12763 | |
| 12764 | Totals deltaTotals = m_totals.delta(prevTotals); |
| 12765 | if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) { |
| 12766 | deltaTotals.assertions.failed++; |
| 12767 | deltaTotals.testCases.passed--; |
| 12768 | deltaTotals.testCases.failed++; |
| 12769 | } |
| 12770 | m_totals.testCases += deltaTotals.testCases; |
| 12771 | m_reporter->testCaseEnded(TestCaseStats(testInfo, |
| 12772 | deltaTotals, |
| 12773 | redirectedCout, |
| 12774 | redirectedCerr, |
| 12775 | aborting())); |
| 12776 | |
| 12777 | m_activeTestCase = nullptr; |
| 12778 | m_testCaseTracker = nullptr; |
| 12779 | |
| 12780 | return deltaTotals; |
| 12781 | } |
| 12782 | |
| 12783 | IConfigPtr RunContext::config() const { |
| 12784 | return m_config; |
no test coverage detected