mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Implemented CHECK_NO_FAIL
This commit is contained in:
@@ -173,13 +173,17 @@ namespace Catch {
|
||||
if( assertionResult.hasExpression() ) {
|
||||
TextColour colour( TextColour::OriginalExpression );
|
||||
m_config.stream << assertionResult.getExpression();
|
||||
if( assertionResult.ok() ) {
|
||||
if( assertionResult.succeeded() ) {
|
||||
TextColour successColour( TextColour::Success );
|
||||
m_config.stream << " succeeded";
|
||||
}
|
||||
else {
|
||||
TextColour errorColour( TextColour::Error );
|
||||
m_config.stream << " failed";
|
||||
if( assertionResult.isOk() ) {
|
||||
TextColour okAnywayColour( TextColour::Success );
|
||||
m_config.stream << " - but was ok";
|
||||
}
|
||||
}
|
||||
}
|
||||
switch( assertionResult.getResultType() ) {
|
||||
@@ -226,13 +230,17 @@ namespace Catch {
|
||||
case ResultWas::ExpressionFailed:
|
||||
case ResultWas::Exception:
|
||||
if( !assertionResult.hasExpression() ) {
|
||||
if( assertionResult.ok() ) {
|
||||
if( assertionResult.succeeded() ) {
|
||||
TextColour colour( TextColour::Success );
|
||||
m_config.stream << " succeeded";
|
||||
}
|
||||
else {
|
||||
TextColour colour( TextColour::Error );
|
||||
m_config.stream << " failed";
|
||||
if( assertionResult.isOk() ) {
|
||||
TextColour okAnywayColour( TextColour::Success );
|
||||
m_config.stream << " - but was ok";
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -81,7 +81,7 @@ namespace Catch {
|
||||
|
||||
if( assertionResult.hasExpression() ) {
|
||||
m_xml.startElement( "Expression" )
|
||||
.writeAttribute( "success", assertionResult.ok() )
|
||||
.writeAttribute( "success", assertionResult.succeeded() )
|
||||
.writeAttribute( "filename", assertionResult.getSourceInfo().file )
|
||||
.writeAttribute( "line", assertionResult.getSourceInfo().line );
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Catch {
|
||||
.writeText( assertionResult.getExpression() );
|
||||
m_xml.scopedElement( "Expanded" )
|
||||
.writeText( assertionResult.getExpandedExpression() );
|
||||
m_currentTestSuccess &= assertionResult.ok();
|
||||
m_currentTestSuccess &= assertionResult.succeeded();
|
||||
}
|
||||
|
||||
switch( assertionResult.getResultType() ) {
|
||||
|
Reference in New Issue
Block a user