MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / runTest

Method runTest

unittests/catch.hpp:8577–8615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8575 }
8576
8577 Totals RunContext::runTest(TestCase const& testCase) {
8578 Totals prevTotals = m_totals;
8579
8580 std::string redirectedCout;
8581 std::string redirectedCerr;
8582
8583 auto const& testInfo = testCase.getTestCaseInfo();
8584
8585 m_reporter->testCaseStarting(testInfo);
8586
8587 m_activeTestCase = &testCase;
8588
8589 ITracker& rootTracker = m_trackerContext.startRun();
8590 assert(rootTracker.isSectionTracker());
8591 static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun());
8592 do {
8593 m_trackerContext.startCycle();
8594 m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo));
8595 runCurrentTest(redirectedCout, redirectedCerr);
8596 } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting());
8597
8598 Totals deltaTotals = m_totals.delta(prevTotals);
8599 if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) {
8600 deltaTotals.assertions.failed++;
8601 deltaTotals.testCases.passed--;
8602 deltaTotals.testCases.failed++;
8603 }
8604 m_totals.testCases += deltaTotals.testCases;
8605 m_reporter->testCaseEnded(TestCaseStats(testInfo,
8606 deltaTotals,
8607 redirectedCout,
8608 redirectedCerr,
8609 aborting()));
8610
8611 m_activeTestCase = nullptr;
8612 m_testCaseTracker = nullptr;
8613
8614 return deltaTotals;
8615 }
8616
8617 IConfigPtr RunContext::config() const {
8618 return m_config;

Callers 1

runTestsFunction · 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