catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Performance improvement
- Commit
b9339333df07c6ff3c13e8df5a8335397397258b- Author
- Neal Coombes ·
- Parents
61e29b563042
Changes
include/internal/catch_assertionhandler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/internal/catch_assertionhandler.cpp b/include/internal/catch_assertionhandler.cpp index 0eed7cd9..3465269f 100644 --- a/include/internal/catch_assertionhandler.cpp +++ b/include/internal/catch_assertionhandler.cpp @@ -72,6 +72,13 @@ namespace Catch { bool negated = isFalseTest( m_assertionInfo.resultDisposition ); bool result = expr.getResult() != negated; + if(result && !getCurrentContext().getConfig()->includeSuccessfulResults()) + { + getCurrentContext().getResultCapture()->assertionRun(); + getCurrentContext().getResultCapture()->assertionPassed(); + return; + } + handle( result ? ResultWas::Ok : ResultWas::ExpressionFailed, &expr, negated ); } void AssertionHandler::handle( ResultWas::OfType resultType ) {