| 6584 | } |
| 6585 | |
| 6586 | Totals runTest( TestCase const& testCase ) { |
| 6587 | Totals prevTotals = m_totals; |
| 6588 | |
| 6589 | std::string redirectedCout; |
| 6590 | std::string redirectedCerr; |
| 6591 | |
| 6592 | TestCaseInfo testInfo = testCase.getTestCaseInfo(); |
| 6593 | |
| 6594 | m_reporter->testCaseStarting( testInfo ); |
| 6595 | |
| 6596 | m_activeTestCase = &testCase; |
| 6597 | |
| 6598 | do { |
| 6599 | ITracker& rootTracker = m_trackerContext.startRun(); |
| 6600 | assert( rootTracker.isSectionTracker() ); |
| 6601 | static_cast<SectionTracker&>( rootTracker ).addInitialFilters( m_config->getSectionsToRun() ); |
| 6602 | do { |
| 6603 | m_trackerContext.startCycle(); |
| 6604 | m_testCaseTracker = &SectionTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation( testInfo.name, testInfo.lineInfo ) ); |
| 6605 | runCurrentTest( redirectedCout, redirectedCerr ); |
| 6606 | } |
| 6607 | while( !m_testCaseTracker->isSuccessfullyCompleted() && !aborting() ); |
| 6608 | } |
| 6609 | // !TBD: deprecated - this will be replaced by indexed trackers |
| 6610 | while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() ); |
| 6611 | |
| 6612 | Totals deltaTotals = m_totals.delta( prevTotals ); |
| 6613 | if( testInfo.expectedToFail() && deltaTotals.testCases.passed > 0 ) { |
| 6614 | deltaTotals.assertions.failed++; |
| 6615 | deltaTotals.testCases.passed--; |
| 6616 | deltaTotals.testCases.failed++; |
| 6617 | } |
| 6618 | m_totals.testCases += deltaTotals.testCases; |
| 6619 | m_reporter->testCaseEnded( TestCaseStats( testInfo, |
| 6620 | deltaTotals, |
| 6621 | redirectedCout, |
| 6622 | redirectedCerr, |
| 6623 | aborting() ) ); |
| 6624 | |
| 6625 | m_activeTestCase = CATCH_NULL; |
| 6626 | m_testCaseTracker = CATCH_NULL; |
| 6627 | |
| 6628 | return deltaTotals; |
| 6629 | } |
| 6630 | |
| 6631 | Ptr<IConfig const> config() const { |
| 6632 | return m_config; |
no test coverage detected