First cut of TeamCity reporter
This commit is contained in:
Phil Nash 2014-12-21 00:21:23 +00:00
parent 3dc3763b07
commit 576aff6085
3 changed files with 36 additions and 19 deletions

View File

@ -1,6 +1,6 @@
![catch logo](catch-logo-small.png) ![catch logo](catch-logo-small.png)
*v1.1 build 9 (develop branch)* *v1.1 build 10 (develop branch)*
Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch) Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch)

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( 1, 1, 9, "develop" ); Version libraryVersion( 1, 1, 10, "develop" );
} }
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@ -1,6 +1,6 @@
/* /*
* CATCH v1.1 build 9 (develop branch) * CATCH v1.1 build 10 (develop branch)
* Generated: 2014-12-15 07:26:07.689692 * Generated: 2014-12-21 00:20:17.212897
* ---------------------------------------------------------- * ----------------------------------------------------------
* 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.
@ -33,11 +33,11 @@
#pragma GCC diagnostic ignored "-Wpadded" #pragma GCC diagnostic ignored "-Wpadded"
#endif #endif
#ifdef CATCH_CONFIG_MAIN #if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER)
# define CATCH_CONFIG_RUNNER # define CATCH_IMPL
#endif #endif
#ifdef CATCH_CONFIG_RUNNER #ifdef CATCH_IMPL
# ifndef CLARA_CONFIG_MAIN # ifndef CLARA_CONFIG_MAIN
# define CLARA_CONFIG_MAIN_NOT_DEFINED # define CLARA_CONFIG_MAIN_NOT_DEFINED
# define CLARA_CONFIG_MAIN # define CLARA_CONFIG_MAIN
@ -227,6 +227,7 @@ namespace Catch {
void toLowerInPlace( std::string& s ); void toLowerInPlace( std::string& s );
std::string toLower( std::string const& s ); std::string toLower( std::string const& s );
std::string trim( std::string const& str ); std::string trim( std::string const& str );
bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis );
struct pluralise { struct pluralise {
pluralise( std::size_t count, std::string const& label ); pluralise( std::size_t count, std::string const& label );
@ -2737,7 +2738,7 @@ return @ desc; \
#endif #endif
#ifdef CATCH_CONFIG_RUNNER #ifdef CATCH_IMPL
// #included from: internal/catch_impl.hpp // #included from: internal/catch_impl.hpp
#define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED #define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED
@ -4676,6 +4677,7 @@ namespace Catch
virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0;
// The return value indicates if the messages buffer should be cleared:
virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0; virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0;
virtual void sectionEnded( SectionStats const& sectionStats ) = 0; virtual void sectionEnded( SectionStats const& sectionStats ) = 0;
virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0;
@ -4824,7 +4826,7 @@ namespace Catch {
} }
inline std::size_t listReporters( Config const& /*config*/ ) { inline std::size_t listReporters( Config const& /*config*/ ) {
Catch::cout() << "Available reports:\n"; Catch::cout() << "Available reporters:\n";
IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it; IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it;
std::size_t maxNameLen = 0; std::size_t maxNameLen = 0;
@ -6669,7 +6671,7 @@ namespace Catch {
namespace Catch { namespace Catch {
// These numbers are maintained by a script // These numbers are maintained by a script
Version libraryVersion( 1, 1, 9, "develop" ); Version libraryVersion( 1, 1, 10, "develop" );
} }
// #included from: catch_message.hpp // #included from: catch_message.hpp
@ -6912,6 +6914,20 @@ namespace Catch {
return start != std::string::npos ? str.substr( start, 1+end-start ) : ""; return start != std::string::npos ? str.substr( start, 1+end-start ) : "";
} }
bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) {
bool replaced = false;
std::size_t i = str.find( replaceThis );
while( i != std::string::npos ) {
replaced = true;
str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() );
if( i < str.size()-withThis.size() )
i = str.find( replaceThis, i+withThis.size() );
else
i = std::string::npos;
}
return replaced;
}
pluralise::pluralise( std::size_t count, std::string const& label ) pluralise::pluralise( std::size_t count, std::string const& label )
: m_count( count ), : m_count( count ),
m_label( label ) m_label( label )
@ -7652,6 +7668,16 @@ namespace Catch {
}; };
template<char C>
char const* getLineOfChars() {
static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0};
if( !*line ) {
memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 );
line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0;
}
return line;
}
} // end namespace Catch } // end namespace Catch
// #included from: ../internal/catch_reporter_registrars.hpp // #included from: ../internal/catch_reporter_registrars.hpp
@ -8724,15 +8750,6 @@ namespace Catch {
void printSummaryDivider() { void printSummaryDivider() {
stream << getLineOfChars<'-'>() << "\n"; stream << getLineOfChars<'-'>() << "\n";
} }
template<char C>
static char const* getLineOfChars() {
static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0};
if( !*line ) {
memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 );
line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0;
}
return line;
}
private: private:
bool m_headerPrinted; bool m_headerPrinted;