| 12120 | } |
| 12121 | |
| 12122 | Totals RunContext::runTest(TestCase const& testCase) { |
| 12123 | Totals prevTotals = m_totals; |
| 12124 | |
| 12125 | std::string redirectedCout; |
| 12126 | std::string redirectedCerr; |
| 12127 | |
| 12128 | auto const& testInfo = testCase.getTestCaseInfo(); |
| 12129 | |
| 12130 | m_reporter->testCaseStarting(testInfo); |
| 12131 | |
| 12132 | m_activeTestCase = &testCase; |
| 12133 | |
| 12134 | ITracker& rootTracker = m_trackerContext.startRun(); |
| 12135 | assert(rootTracker.isSectionTracker()); |
| 12136 | static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun()); |
| 12137 | do { |
| 12138 | m_trackerContext.startCycle(); |
| 12139 | m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo)); |
| 12140 | runCurrentTest(redirectedCout, redirectedCerr); |
| 12141 | } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); |
| 12142 | |
| 12143 | Totals deltaTotals = m_totals.delta(prevTotals); |
| 12144 | if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) { |
| 12145 | deltaTotals.assertions.failed++; |
| 12146 | deltaTotals.testCases.passed--; |
| 12147 | deltaTotals.testCases.failed++; |
| 12148 | } |
| 12149 | m_totals.testCases += deltaTotals.testCases; |
| 12150 | m_reporter->testCaseEnded(TestCaseStats(testInfo, |
| 12151 | deltaTotals, |
| 12152 | redirectedCout, |
| 12153 | redirectedCerr, |
| 12154 | aborting())); |
| 12155 | |
| 12156 | m_activeTestCase = nullptr; |
| 12157 | m_testCaseTracker = nullptr; |
| 12158 | |
| 12159 | return deltaTotals; |
| 12160 | } |
| 12161 | |
| 12162 | IConfigPtr RunContext::config() const { |
| 12163 | return m_config; |
no test coverage detected