This commit is contained in:
Phil Nash 2013-03-08 09:30:25 +00:00
parent e57a56bb28
commit a04981b450
4 changed files with 53 additions and 52 deletions

2
README
View File

@ -1,4 +1,4 @@
CATCH v0.9 build 21 (integration branch) CATCH v0.9 build 22 (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, 21, "integration" ); Version libraryVersion( 0, 9, 22, "integration" );
} }
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@ -1,5 +1,5 @@
CatchSelfTest is a CATCH v0.9 b21 (integration) host application. CatchSelfTest is a CATCH v0.9 b22 (integration) host application.
Run with -? for options Run with -? for options
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -4286,7 +4286,7 @@ with expansion:
101 test cases - 47 failed (625 assertions - 104 failed) 101 test cases - 47 failed (625 assertions - 104 failed)
CatchSelfTest is a CATCH v0.9 b21 (integration) host application. CatchSelfTest is a CATCH v0.9 b22 (integration) host application.
Run with -? for options Run with -? for options
------------------------------------------------------------------------------- -------------------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
/* /*
* CATCH v0.9 build 21 (integration branch) * CATCH v0.9 build 22 (integration branch)
* Generated: 2013-03-04 15:05:07.210014 * Generated: 2013-03-08 09:29:15.097480
* ---------------------------------------------------------- * ----------------------------------------------------------
* 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.
@ -5869,7 +5869,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, 21, "integration" ); Version libraryVersion( 0, 9, 22, "integration" );
} }
// #included from: catch_line_wrap.hpp // #included from: catch_line_wrap.hpp
@ -6957,7 +6957,7 @@ namespace Catch {
struct ConsoleReporter : StreamingReporterBase { struct ConsoleReporter : StreamingReporterBase {
ConsoleReporter( ReporterConfig const& _config ) ConsoleReporter( ReporterConfig const& _config )
: StreamingReporterBase( _config ), : StreamingReporterBase( _config ),
m_printedCurrentSection( false ), m_headerPrinted( false ),
m_atLeastOneTestCasePrinted( false ) m_atLeastOneTestCasePrinted( false )
{} {}
@ -6990,7 +6990,7 @@ namespace Catch {
} }
virtual void sectionStarting( SectionInfo const& _sectionInfo ) { virtual void sectionStarting( SectionInfo const& _sectionInfo ) {
m_printedCurrentSection = false; m_headerPrinted = false;
StreamingReporterBase::sectionStarting( _sectionInfo ); StreamingReporterBase::sectionStarting( _sectionInfo );
} }
virtual void sectionEnded( SectionStats const& _sectionStats ) { virtual void sectionEnded( SectionStats const& _sectionStats ) {
@ -6999,7 +6999,7 @@ namespace Catch {
TextColour colour( TextColour::ResultError ); TextColour colour( TextColour::ResultError );
stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; stream << "\nNo assertions in section, '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
} }
m_printedCurrentSection = false; m_headerPrinted = false;
StreamingReporterBase::sectionEnded( _sectionStats ); StreamingReporterBase::sectionEnded( _sectionStats );
} }
@ -7011,6 +7011,7 @@ namespace Catch {
stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl; stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl;
} }
StreamingReporterBase::testCaseEnded( _testCaseStats ); StreamingReporterBase::testCaseEnded( _testCaseStats );
m_headerPrinted = false;
} }
virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) { virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) {
if( !unusedGroupInfo ) { if( !unusedGroupInfo ) {
@ -7190,11 +7191,11 @@ namespace Catch {
lazyPrintRunInfo(); lazyPrintRunInfo();
if( unusedGroupInfo ) if( unusedGroupInfo )
lazyPrintGroupInfo(); lazyPrintGroupInfo();
if( unusedTestCaseInfo )
lazyPrintTestCaseInfo();
if( currentSectionInfo && !m_printedCurrentSection )
lazyPrintSectionInfo();
if( !m_headerPrinted ) {
printTestCaseAndSectionHeader();
m_headerPrinted = true;
}
m_atLeastOneTestCasePrinted = true; m_atLeastOneTestCasePrinted = true;
} }
void lazyPrintRunInfo() { void lazyPrintRunInfo() {
@ -7211,19 +7212,19 @@ namespace Catch {
} }
void lazyPrintGroupInfo() { void lazyPrintGroupInfo() {
if( !unusedGroupInfo->name.empty() && unusedGroupInfo->groupsCounts > 1 ) { if( !unusedGroupInfo->name.empty() && unusedGroupInfo->groupsCounts > 1 ) {
printHeader( "Group: " + unusedGroupInfo->name ); printClosedHeader( "Group: " + unusedGroupInfo->name );
unusedGroupInfo.reset(); unusedGroupInfo.reset();
} }
} }
void lazyPrintTestCaseInfo() { void lazyPrintTestCaseInfo() {
if( !currentSectionInfo ) { if( !currentSectionInfo ) {
printHeader( unusedTestCaseInfo->name ); printClosedHeader( unusedTestCaseInfo->name );
stream << std::endl; stream << std::endl;
// unusedTestCaseInfo.reset();
} }
} }
void lazyPrintSectionInfo() { void printTestCaseAndSectionHeader() {
printOpenHeader( unusedTestCaseInfo->name );
if( currentSectionInfo ) {
std::vector<ThreadedSectionInfo*> sections; std::vector<ThreadedSectionInfo*> sections;
for( ThreadedSectionInfo* section = currentSectionInfo.get(); for( ThreadedSectionInfo* section = currentSectionInfo.get();
section; section;
@ -7232,21 +7233,21 @@ namespace Catch {
// Sections // Sections
if( !sections.empty() ) { if( !sections.empty() ) {
printHeader( unusedTestCaseInfo->name, false );
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 << getDots() << "\n" << std::endl; stream << getDots() << "\n" << std::endl;
} }
m_printedCurrentSection = true;
}
void printHeader( std::string const& _name, bool closed = true ) { void printClosedHeader( std::string const& _name ) {
printOpenHeader( _name );
stream << getDots() << "\n";
}
void printOpenHeader( std::string const& _name ) {
stream << getDashes() << "\n" stream << getDashes() << "\n"
<< _name << "\n"; << _name << "\n";
if( closed )
stream << getDots() << "\n";
} }
void printTotals( const Totals& totals ) { void printTotals( const Totals& totals ) {
@ -7316,7 +7317,7 @@ namespace Catch {
} }
private: private:
bool m_printedCurrentSection; bool m_headerPrinted;
bool m_atLeastOneTestCasePrinted; bool m_atLeastOneTestCasePrinted;
}; };