| 8685 | } |
| 8686 | |
| 8687 | void RunContext::handleFatalErrorCondition(StringRef message) { |
| 8688 | // First notify reporter that bad things happened |
| 8689 | m_reporter->fatalErrorEncountered(message); |
| 8690 | |
| 8691 | // Don't rebuild the result -- the stringification itself can cause more fatal errors |
| 8692 | // Instead, fake a result data. |
| 8693 | AssertionResultData tempResult(ResultWas::FatalErrorCondition, {false}); |
| 8694 | tempResult.message = message; |
| 8695 | AssertionResult result(m_lastAssertionInfo, tempResult); |
| 8696 | |
| 8697 | assertionEnded(result); |
| 8698 | |
| 8699 | handleUnfinishedSections(); |
| 8700 | |
| 8701 | // Recreate section for test case (as we will lose the one that was in scope) |
| 8702 | auto const &testCaseInfo = m_activeTestCase->getTestCaseInfo(); |
| 8703 | SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description); |
| 8704 | |
| 8705 | Counts assertions; |
| 8706 | assertions.failed = 1; |
| 8707 | SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false); |
| 8708 | m_reporter->sectionEnded(testCaseSectionStats); |
| 8709 | |
| 8710 | auto const &testInfo = m_activeTestCase->getTestCaseInfo(); |
| 8711 | |
| 8712 | Totals deltaTotals; |
| 8713 | deltaTotals.testCases.failed = 1; |
| 8714 | deltaTotals.assertions.failed = 1; |
| 8715 | m_reporter->testCaseEnded(TestCaseStats(testInfo, deltaTotals, std::string(), std::string(), false)); |
| 8716 | m_totals.testCases.failed++; |
| 8717 | testGroupEnded(std::string(), m_totals, 1, 1); |
| 8718 | m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false)); |
| 8719 | } |
| 8720 | |
| 8721 | bool RunContext::lastAssertionPassed() { |
| 8722 | return m_lastAssertionPassed; |
no test coverage detected