MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / runTest

Method runTest

Bcore/src/main/cpp/Dobby/tests/catch.hpp:8538–8573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8536}
8537
8538Totals RunContext::runTest(TestCase const &testCase) {
8539 Totals prevTotals = m_totals;
8540
8541 std::string redirectedCout;
8542 std::string redirectedCerr;
8543
8544 auto const &testInfo = testCase.getTestCaseInfo();
8545
8546 m_reporter->testCaseStarting(testInfo);
8547
8548 m_activeTestCase = &testCase;
8549
8550 ITracker &rootTracker = m_trackerContext.startRun();
8551 assert(rootTracker.isSectionTracker());
8552 static_cast<SectionTracker &>(rootTracker).addInitialFilters(m_config->getSectionsToRun());
8553 do {
8554 m_trackerContext.startCycle();
8555 m_testCaseTracker =
8556 &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo));
8557 runCurrentTest(redirectedCout, redirectedCerr);
8558 } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting());
8559
8560 Totals deltaTotals = m_totals.delta(prevTotals);
8561 if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) {
8562 deltaTotals.assertions.failed++;
8563 deltaTotals.testCases.passed--;
8564 deltaTotals.testCases.failed++;
8565 }
8566 m_totals.testCases += deltaTotals.testCases;
8567 m_reporter->testCaseEnded(TestCaseStats(testInfo, deltaTotals, redirectedCout, redirectedCerr, aborting()));
8568
8569 m_activeTestCase = nullptr;
8570 m_testCaseTracker = nullptr;
8571
8572 return deltaTotals;
8573}
8574
8575IConfigPtr RunContext::config() const {
8576 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