| 10095 | } |
| 10096 | |
| 10097 | Totals RunContext::runTest(TestCase const& testCase) { |
| 10098 | Totals prevTotals = m_totals; |
| 10099 | |
| 10100 | std::string redirectedCout; |
| 10101 | std::string redirectedCerr; |
| 10102 | |
| 10103 | auto const& testInfo = testCase.getTestCaseInfo(); |
| 10104 | |
| 10105 | m_reporter->testCaseStarting(testInfo); |
| 10106 | |
| 10107 | m_activeTestCase = &testCase; |
| 10108 | |
| 10109 | ITracker& rootTracker = m_trackerContext.startRun(); |
| 10110 | assert(rootTracker.isSectionTracker()); |
| 10111 | static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun()); |
| 10112 | do { |
| 10113 | m_trackerContext.startCycle(); |
| 10114 | m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo)); |
| 10115 | runCurrentTest(redirectedCout, redirectedCerr); |
| 10116 | } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); |
| 10117 | |
| 10118 | Totals deltaTotals = m_totals.delta(prevTotals); |
| 10119 | if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) { |
| 10120 | deltaTotals.assertions.failed++; |
| 10121 | deltaTotals.testCases.passed--; |
| 10122 | deltaTotals.testCases.failed++; |
| 10123 | } |
| 10124 | m_totals.testCases += deltaTotals.testCases; |
| 10125 | m_reporter->testCaseEnded(TestCaseStats(testInfo, |
| 10126 | deltaTotals, |
| 10127 | redirectedCout, |
| 10128 | redirectedCerr, |
| 10129 | aborting())); |
| 10130 | |
| 10131 | m_activeTestCase = nullptr; |
| 10132 | m_testCaseTracker = nullptr; |
| 10133 | |
| 10134 | return deltaTotals; |
| 10135 | } |
| 10136 | |
| 10137 | IConfigPtr RunContext::config() const { |
| 10138 | return m_config; |
no test coverage detected