MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / runTest

Method runTest

extern/Catch2/catch.hpp:12741–12779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

executeMethod · 0.80

Calls 10

NameAndLocationClass · 0.85
TestCaseStatsClass · 0.85
isSectionTrackerMethod · 0.80
addInitialFiltersMethod · 0.80
startCycleMethod · 0.80
deltaMethod · 0.80
expectedToFailMethod · 0.80
testCaseStartingMethod · 0.45
testCaseEndedMethod · 0.45

Tested by

no test coverage detected