MCPcopy Create free account
hub / github.com/Profactor/cv-plot / handleFatalErrorCondition

Method handleFatalErrorCondition

CvPlot/ext/catch2/inc/catch.hpp:12685–12721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12683 }
12684
12685 void RunContext::handleFatalErrorCondition( StringRef message ) {
12686 // First notify reporter that bad things happened
12687 m_reporter->fatalErrorEncountered(message);
12688
12689 // Don't rebuild the result -- the stringification itself can cause more fatal errors
12690 // Instead, fake a result data.
12691 AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } );
12692 tempResult.message = static_cast<std::string>(message);
12693 AssertionResult result(m_lastAssertionInfo, tempResult);
12694
12695 assertionEnded(result);
12696
12697 handleUnfinishedSections();
12698
12699 // Recreate section for test case (as we will lose the one that was in scope)
12700 auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
12701 SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
12702
12703 Counts assertions;
12704 assertions.failed = 1;
12705 SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false);
12706 m_reporter->sectionEnded(testCaseSectionStats);
12707
12708 auto const& testInfo = m_activeTestCase->getTestCaseInfo();
12709
12710 Totals deltaTotals;
12711 deltaTotals.testCases.failed = 1;
12712 deltaTotals.assertions.failed = 1;
12713 m_reporter->testCaseEnded(TestCaseStats(testInfo,
12714 deltaTotals,
12715 std::string(),
12716 std::string(),
12717 false));
12718 m_totals.testCases.failed++;
12719 testGroupEnded(std::string(), m_totals, 1, 1);
12720 m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
12721 }
12722
12723 bool RunContext::lastAssertionPassed() {
12724 return m_lastAssertionPassed;

Callers 1

reportFatalFunction · 0.80

Calls 6

TestCaseStatsClass · 0.85
TestRunStatsClass · 0.85
fatalErrorEncounteredMethod · 0.80
sectionEndedMethod · 0.45
testCaseEndedMethod · 0.45
testRunEndedMethod · 0.45

Tested by

no test coverage detected