| 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; |
no test coverage detected