Implemented CHECK_NO_FAIL

This commit is contained in:
Phil Nash
2012-11-13 09:44:52 +00:00
parent af1a321860
commit d539da9030
12 changed files with 119 additions and 55 deletions

View File

@@ -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;

View File

@@ -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() ) {