MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / handleFatalErrorCondition

Method handleFatalErrorCondition

test/expected/catch.hpp:12703–12739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12701 }
12702
12703 void RunContext::handleFatalErrorCondition( StringRef message ) {
12704 // First notify reporter that bad things happened
12705 m_reporter->fatalErrorEncountered(message);
12706
12707 // Don't rebuild the result -- the stringification itself can cause more fatal errors
12708 // Instead, fake a result data.
12709 AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } );
12710 tempResult.message = static_cast<std::string>(message);
12711 AssertionResult result(m_lastAssertionInfo, tempResult);
12712
12713 assertionEnded(result);
12714
12715 handleUnfinishedSections();
12716
12717 // Recreate section for test case (as we will lose the one that was in scope)
12718 auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
12719 SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
12720
12721 Counts assertions;
12722 assertions.failed = 1;
12723 SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false);
12724 m_reporter->sectionEnded(testCaseSectionStats);
12725
12726 auto const& testInfo = m_activeTestCase->getTestCaseInfo();
12727
12728 Totals deltaTotals;
12729 deltaTotals.testCases.failed = 1;
12730 deltaTotals.assertions.failed = 1;
12731 m_reporter->testCaseEnded(TestCaseStats(testInfo,
12732 deltaTotals,
12733 std::string(),
12734 std::string(),
12735 false));
12736 m_totals.testCases.failed++;
12737 testGroupEnded(std::string(), m_totals, 1, 1);
12738 m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
12739 }
12740
12741 bool RunContext::lastAssertionPassed() {
12742 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