| 10522 | } |
| 10523 | |
| 10524 | void RunContext::handleFatalErrorCondition( StringRef message ) { |
| 10525 | // First notify reporter that bad things happened |
| 10526 | m_reporter->fatalErrorEncountered(message); |
| 10527 | |
| 10528 | // Don't rebuild the result -- the stringification itself can cause more fatal errors |
| 10529 | // Instead, fake a result data. |
| 10530 | AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } ); |
| 10531 | tempResult.message = message; |
| 10532 | AssertionResult result(m_lastAssertionInfo, tempResult); |
| 10533 | |
| 10534 | assertionEnded(result); |
| 10535 | |
| 10536 | handleUnfinishedSections(); |
| 10537 | |
| 10538 | // Recreate section for test case (as we will lose the one that was in scope) |
| 10539 | auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); |
| 10540 | SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name); |
| 10541 | |
| 10542 | Counts assertions; |
| 10543 | assertions.failed = 1; |
| 10544 | SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false); |
| 10545 | m_reporter->sectionEnded(testCaseSectionStats); |
| 10546 | |
| 10547 | auto const& testInfo = m_activeTestCase->getTestCaseInfo(); |
| 10548 | |
| 10549 | Totals deltaTotals; |
| 10550 | deltaTotals.testCases.failed = 1; |
| 10551 | deltaTotals.assertions.failed = 1; |
| 10552 | m_reporter->testCaseEnded(TestCaseStats(testInfo, |
| 10553 | deltaTotals, |
| 10554 | std::string(), |
| 10555 | std::string(), |
| 10556 | false)); |
| 10557 | m_totals.testCases.failed++; |
| 10558 | testGroupEnded(std::string(), m_totals, 1, 1); |
| 10559 | m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false)); |
| 10560 | } |
| 10561 | |
| 10562 | bool RunContext::lastAssertionPassed() { |
| 10563 | return m_lastAssertionPassed; |
no test coverage detected