| 12298 | } |
| 12299 | |
| 12300 | void RunContext::handleFatalErrorCondition( StringRef message ) { |
| 12301 | // First notify reporter that bad things happened |
| 12302 | m_reporter->fatalErrorEncountered(message); |
| 12303 | |
| 12304 | // Don't rebuild the result -- the stringification itself can cause more fatal errors |
| 12305 | // Instead, fake a result data. |
| 12306 | AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } ); |
| 12307 | tempResult.message = message; |
| 12308 | AssertionResult result(m_lastAssertionInfo, tempResult); |
| 12309 | |
| 12310 | assertionEnded(result); |
| 12311 | |
| 12312 | handleUnfinishedSections(); |
| 12313 | |
| 12314 | // Recreate section for test case (as we will lose the one that was in scope) |
| 12315 | auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); |
| 12316 | SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name); |
| 12317 | |
| 12318 | Counts assertions; |
| 12319 | assertions.failed = 1; |
| 12320 | SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false); |
| 12321 | m_reporter->sectionEnded(testCaseSectionStats); |
| 12322 | |
| 12323 | auto const& testInfo = m_activeTestCase->getTestCaseInfo(); |
| 12324 | |
| 12325 | Totals deltaTotals; |
| 12326 | deltaTotals.testCases.failed = 1; |
| 12327 | deltaTotals.assertions.failed = 1; |
| 12328 | m_reporter->testCaseEnded(TestCaseStats(testInfo, |
| 12329 | deltaTotals, |
| 12330 | std::string(), |
| 12331 | std::string(), |
| 12332 | false)); |
| 12333 | m_totals.testCases.failed++; |
| 12334 | testGroupEnded(std::string(), m_totals, 1, 1); |
| 12335 | m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false)); |
| 12336 | } |
| 12337 | |
| 12338 | bool RunContext::lastAssertionPassed() { |
| 12339 | return m_lastAssertionPassed; |
no test coverage detected