Eliminate some work when results won't be reported.

This commit is contained in:
Neal Coombes
2017-06-26 14:30:23 -05:00
committed by Martin Hořeňovský
parent 28741467d5
commit 2212cdfe26
6 changed files with 60 additions and 20 deletions

View File

@@ -213,6 +213,20 @@ namespace Catch {
m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
}
bool RunContext::lastAssertionPassed() {
return m_totals.assertions.passed == (m_prevPassed + 1);
}
void RunContext::assertionPassed() {
++m_totals.assertions.passed;
m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}";
m_lastAssertionInfo.macroName = "";
}
void RunContext::assertionRun() {
m_prevPassed = m_totals.assertions.passed;
}
bool RunContext::aborting() const {
return m_totals.assertions.failed == static_cast<std::size_t>(m_config->abortAfter());
}