More console reporter tweaks and approved new output

This commit is contained in:
Phil Nash 2013-01-14 18:36:25 +00:00
parent bb76e47704
commit 21c479f5aa
2 changed files with 3166 additions and 2814 deletions

View File

@ -140,7 +140,10 @@ namespace Catch {
} }
bool printResultType( AssertionResult const& _result ) { bool printResultType( AssertionResult const& _result ) {
if( _result.succeeded() ) { if( _result.getResultType() == ResultWas::Info ||
_result.getResultType() == ResultWas::Warning ) {
}
else if( _result.succeeded() ) {
TextColour successColour( TextColour::Success ); TextColour successColour( TextColour::Success );
stream << "passed "; stream << "passed ";
} }
@ -181,7 +184,7 @@ namespace Catch {
std::pair<std::string, std::string> message = getMessage( _result ); std::pair<std::string, std::string> message = getMessage( _result );
bool endsWithNewLine = false; bool endsWithNewLine = false;
if( !message.first.empty() ) { if( !message.first.empty() ) {
stream << " " << message.first << ":" << "\n"; stream << message.first << ":" << "\n";
endsWithNewLine = true; endsWithNewLine = true;
} }
if( !message.second.empty() ) { if( !message.second.empty() ) {
@ -197,9 +200,9 @@ namespace Catch {
case ResultWas::DidntThrowException: case ResultWas::DidntThrowException:
return std::make_pair( "because no exception was thrown where one was expected", "" ); return std::make_pair( "because no exception was thrown where one was expected", "" );
case ResultWas::Info: case ResultWas::Info:
return std::make_pair( "with info", _result.getMessage() ); return std::make_pair( "info", _result.getMessage() );
case ResultWas::Warning: case ResultWas::Warning:
return std::make_pair( "with warning", _result.getMessage() ); return std::make_pair( "warning", _result.getMessage() );
case ResultWas::ExplicitFailure: case ResultWas::ExplicitFailure:
return std::make_pair( "explicitly with message", _result.getMessage() ); return std::make_pair( "explicitly with message", _result.getMessage() );

File diff suppressed because it is too large Load Diff