More console reporter tweaks

This commit is contained in:
Phil Nash 2013-01-18 08:09:28 +00:00
parent b588755a92
commit 3ce320db4f
5 changed files with 830 additions and 826 deletions

2
README
View File

@ -1,4 +1,4 @@
CATCH v0.9 build 14 (integration branch) CATCH v0.9 build 15 (integration branch)
--------------------------------------------- ---------------------------------------------
CATCH is an automated test framework for C, C++ and Objective-C. CATCH is an automated test framework for C, C++ and Objective-C.

View File

@ -13,7 +13,7 @@
namespace Catch { namespace Catch {
// These numbers are maintained by a script // These numbers are maintained by a script
Version libraryVersion( 0, 9, 14, "integration" ); Version libraryVersion( 0, 9, 15, "integration" );
} }
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@ -48,19 +48,16 @@ namespace Catch {
if( _assertionStats.totals.assertions.total() > 0 ) { if( _assertionStats.totals.assertions.total() > 0 ) {
printResultType( components ); printResultType( components );
printOriginalExpression( result ); printOriginalExpression( result );
// printResultType( components );
endsWithNewLine = printReconstructedExpression( result ); endsWithNewLine = printReconstructedExpression( result );
} }
endsWithNewLine |= printMessage( components ); endsWithNewLine |= printMessage( components );
// if( !endsWithNewLine )
// stream << "\n";
printSourceInfo( result ); printSourceInfo( result );
stream << std::endl; stream << std::endl;
} }
void printSourceInfo( AssertionResult const& _result ) { void printSourceInfo( AssertionResult const& _result ) {
TextColour colour( TextColour::FileName ); TextColour colour( TextColour::FileName );
stream << _result.getSourceInfo() << "\n"; stream << _result.getSourceInfo() << ":\n";
} }
struct ResultComponents { struct ResultComponents {
@ -266,7 +263,7 @@ namespace Catch {
typedef std::vector<ThreadedSectionInfo*>::const_reverse_iterator It; typedef std::vector<ThreadedSectionInfo*>::const_reverse_iterator It;
for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it )
stream << " " << (*it)->name << "\n"; stream << " " << (*it)->name << "\n";
stream << getDashes() << "\n" << std::endl; stream << getDots() << "\n" << std::endl;
unusedSectionInfo.reset(); unusedSectionInfo.reset();
} }
} }
@ -275,7 +272,7 @@ namespace Catch {
stream << getDashes() << "\n" stream << getDashes() << "\n"
<< _name << "\n"; << _name << "\n";
if( closed ) if( closed )
stream << getDashes() << "\n"; stream << getDots() << "\n";
} }
void printTotals( const Totals& totals ) { void printTotals( const Totals& totals ) {
@ -336,6 +333,11 @@ namespace Catch {
= "-----------------------------------------------------------------"; = "-----------------------------------------------------------------";
return dashes; return dashes;
} }
static std::string const& getDots() {
static const std::string dots
= ".................................................................";
return dots;
}
static std::string const& getDoubleDashes() { static std::string const& getDoubleDashes() {
static const std::string doubleDashes static const std::string doubleDashes
= "================================================================="; = "=================================================================";

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* /*
* CATCH v0.9 build 14 (integration branch) * CATCH v0.9 build 15 (integration branch)
* Generated: 2013-01-17 12:06:33.338396 * Generated: 2013-01-18 08:08:03.925034
* ---------------------------------------------------------- * ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly * This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
@ -5777,7 +5777,7 @@ namespace Catch {
namespace Catch { namespace Catch {
// These numbers are maintained by a script // These numbers are maintained by a script
Version libraryVersion( 0, 9, 14, "integration" ); Version libraryVersion( 0, 9, 15, "integration" );
} }
// #included from: catch_line_wrap.hpp // #included from: catch_line_wrap.hpp
@ -6850,19 +6850,16 @@ namespace Catch {
if( _assertionStats.totals.assertions.total() > 0 ) { if( _assertionStats.totals.assertions.total() > 0 ) {
printResultType( components ); printResultType( components );
printOriginalExpression( result ); printOriginalExpression( result );
// printResultType( components );
endsWithNewLine = printReconstructedExpression( result ); endsWithNewLine = printReconstructedExpression( result );
} }
endsWithNewLine |= printMessage( components ); endsWithNewLine |= printMessage( components );
// if( !endsWithNewLine )
// stream << "\n";
printSourceInfo( result ); printSourceInfo( result );
stream << std::endl; stream << std::endl;
} }
void printSourceInfo( AssertionResult const& _result ) { void printSourceInfo( AssertionResult const& _result ) {
TextColour colour( TextColour::FileName ); TextColour colour( TextColour::FileName );
stream << _result.getSourceInfo() << "\n"; stream << _result.getSourceInfo() << ":\n";
} }
struct ResultComponents { struct ResultComponents {
@ -7068,7 +7065,7 @@ namespace Catch {
typedef std::vector<ThreadedSectionInfo*>::const_reverse_iterator It; typedef std::vector<ThreadedSectionInfo*>::const_reverse_iterator It;
for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it ) for( It it = sections.rbegin(), itEnd = sections.rend(); it != itEnd; ++it )
stream << " " << (*it)->name << "\n"; stream << " " << (*it)->name << "\n";
stream << getDashes() << "\n" << std::endl; stream << getDots() << "\n" << std::endl;
unusedSectionInfo.reset(); unusedSectionInfo.reset();
} }
} }
@ -7077,7 +7074,7 @@ namespace Catch {
stream << getDashes() << "\n" stream << getDashes() << "\n"
<< _name << "\n"; << _name << "\n";
if( closed ) if( closed )
stream << getDashes() << "\n"; stream << getDots() << "\n";
} }
void printTotals( const Totals& totals ) { void printTotals( const Totals& totals ) {
@ -7138,6 +7135,11 @@ namespace Catch {
= "-----------------------------------------------------------------"; = "-----------------------------------------------------------------";
return dashes; return dashes;
} }
static std::string const& getDots() {
static const std::string dots
= ".................................................................";
return dots;
}
static std::string const& getDoubleDashes() { static std::string const& getDoubleDashes() {
static const std::string doubleDashes static const std::string doubleDashes
= "================================================================="; = "=================================================================";