From ef950202393f981a74a2178e859b275d78dc7c59 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 7 Dec 2013 09:08:01 +0000 Subject: [PATCH 1/4] Stop overloading virtualise defined at multiple levels --- include/reporters/catch_reporter_bases.hpp | 4 ++-- include/reporters/catch_reporter_junit.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/reporters/catch_reporter_bases.hpp b/include/reporters/catch_reporter_bases.hpp index a109d860..451b5a75 100644 --- a/include/reporters/catch_reporter_bases.hpp +++ b/include/reporters/catch_reporter_bases.hpp @@ -168,9 +168,9 @@ namespace Catch { Ptr node = new TestRunNode( testRunStats ); node->children.swap( m_testGroups ); m_testRuns.push_back( node ); - testRunEnded(); + testRunEndedCumulative(); } - virtual void testRunEnded() = 0; + virtual void testRunEndedCumulative() = 0; Ptr m_config; std::ostream& stream; diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index db12635b..57395930 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -70,7 +70,7 @@ namespace Catch { writeGroup( *m_testGroups.back(), suiteTime ); } - virtual void testRunEnded() { + virtual void testRunEndedCumulative() { xml.endElement(); } From a1e87a4b7df92061af9fc4c7f1c39fe98c68890d Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 10 Dec 2013 08:20:46 +0000 Subject: [PATCH 2/4] trim test/ section names in xml reporter - BDD-style test names have leading spaces for alignment in the console reporter --- include/internal/catch_common.h | 10 --- include/reporters/catch_reporter_xml.hpp | 4 +- .../SelfTest/Baselines/xml.sw.approved.txt | 68 +++++++++---------- 3 files changed, 36 insertions(+), 46 deletions(-) diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 957ce257..5b091b0a 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -57,16 +57,6 @@ namespace Catch { delete it->second; } - template - inline void forEach( ContainerT& container, Function function ) { - std::for_each( container.begin(), container.end(), function ); - } - - template - inline void forEach( ContainerT const& container, Function function ) { - std::for_each( container.begin(), container.end(), function ); - } - bool startsWith( std::string const& s, std::string const& prefix ); bool endsWith( std::string const& s, std::string const& suffix ); bool contains( std::string const& s, std::string const& infix ); diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index 11ecd910..15aa828f 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -59,7 +59,7 @@ namespace Catch { virtual void StartSection( const std::string& sectionName, const std::string& description ) { if( m_sectionDepth++ > 0 ) { m_xml.startElement( "Section" ) - .writeAttribute( "name", sectionName ) + .writeAttribute( "name", trim( sectionName ) ) .writeAttribute( "description", description ); } } @@ -76,7 +76,7 @@ namespace Catch { } virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) { - m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.name ); + m_xml.startElement( "TestCase" ).writeAttribute( "name", trim( testInfo.name ) ); m_currentTestSuccess = true; } diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index ded8c1f2..8b90d872 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -6671,18 +6671,18 @@ there" -
+
-
-
+
+
-
-
-
+
+
+
itDoesThis() @@ -6697,9 +6697,9 @@ there"
-
-
-
+
+
+
itDoesThis() @@ -6708,7 +6708,7 @@ there" true -
+
itDoesThat() @@ -6728,7 +6728,7 @@ there" -
+
v.size() == 0 @@ -6739,7 +6739,7 @@ there"
-
+
v.size() == 0 @@ -6748,12 +6748,12 @@ there" 0 == 0 -
+
-
+
v.size() == 0 @@ -6762,8 +6762,8 @@ there" 0 == 0 -
-
+
+
v.size() == 10 @@ -6786,7 +6786,7 @@ there"
-
+
v.size() == 0 @@ -6795,8 +6795,8 @@ there" 0 == 0 -
-
+
+
v.size() == 10 @@ -6822,7 +6822,7 @@ there"
-
+
v.size() == 0 @@ -6831,8 +6831,8 @@ there" 0 == 0 -
-
+
+
v.size() == 10 @@ -6850,7 +6850,7 @@ there"
-
+
v.size() == 5 @@ -6877,7 +6877,7 @@ there"
-
+
v.size() == 0 @@ -6886,12 +6886,12 @@ there" 0 == 0 -
+
-
+
v.size() == 0 @@ -6900,8 +6900,8 @@ there" 0 == 0 -
-
+
+
v.capacity() >= 10 @@ -6927,18 +6927,18 @@ there" -
+
-
-
+
+
-
-
-
+
+
+
From 0b63e0d8686ac3b2cfec1538e3bcb82e5088e10b Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 11 Dec 2013 08:26:56 +0000 Subject: [PATCH 3/4] =?UTF-8?q?Fixed=20warnings=20for=20platforms=20that?= =?UTF-8?q?=20don=E2=80=99t=20implement=20CATCH=5FBREAK=5FINTO=5FDEBUGGER?= =?UTF-8?q?=20-=20as=20discussed=20in=20#229?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/internal/catch_debugger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_debugger.h b/include/internal/catch_debugger.h index 0fb6621b..1ac53cd0 100644 --- a/include/internal/catch_debugger.h +++ b/include/internal/catch_debugger.h @@ -43,7 +43,7 @@ namespace Catch{ #endif #ifndef CATCH_BREAK_INTO_DEBUGGER -#define CATCH_BREAK_INTO_DEBUGGER() +#define CATCH_BREAK_INTO_DEBUGGER() Catch::isTrue( true ); #endif #endif // TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED From a6d74bd55aeff9a2506906e451305364f7a02d34 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 11 Dec 2013 08:28:15 +0000 Subject: [PATCH 4/4] Build 17 --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 28 +++++++++------------------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 5e93e7d2..79dd804e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](catch-logo-small.png) -*v1.0 build 16 (master branch)* +*v1.0 build 17 (master branch)* Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch) diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 13f1169a..ace89c57 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 16, "master" ); + Version libraryVersion( 1, 0, 17, "master" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/single_include/catch.hpp b/single_include/catch.hpp index f192075d..ff06ee2c 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v1.0 build 16 (master branch) - * Generated: 2013-12-04 20:23:35.145591 + * CATCH v1.0 build 17 (master branch) + * Generated: 2013-12-11 08:27:45.976816 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -149,16 +149,6 @@ namespace Catch { delete it->second; } - template - inline void forEach( ContainerT& container, Function function ) { - std::for_each( container.begin(), container.end(), function ); - } - - template - inline void forEach( ContainerT const& container, Function function ) { - std::for_each( container.begin(), container.end(), function ); - } - bool startsWith( std::string const& s, std::string const& prefix ); bool endsWith( std::string const& s, std::string const& suffix ); bool contains( std::string const& s, std::string const& infix ); @@ -1396,7 +1386,7 @@ namespace Catch{ #endif #ifndef CATCH_BREAK_INTO_DEBUGGER -#define CATCH_BREAK_INTO_DEBUGGER() +#define CATCH_BREAK_INTO_DEBUGGER() Catch::isTrue( true ); #endif // #included from: catch_interfaces_registry_hub.h @@ -6139,7 +6129,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 16, "master" ); + Version libraryVersion( 1, 0, 17, "master" ); } // #included from: catch_text.hpp @@ -6788,9 +6778,9 @@ namespace Catch { Ptr node = new TestRunNode( testRunStats ); node->children.swap( m_testGroups ); m_testRuns.push_back( node ); - testRunEnded(); + testRunEndedCumulative(); } - virtual void testRunEnded() = 0; + virtual void testRunEndedCumulative() = 0; Ptr m_config; std::ostream& stream; @@ -7120,7 +7110,7 @@ namespace Catch { virtual void StartSection( const std::string& sectionName, const std::string& description ) { if( m_sectionDepth++ > 0 ) { m_xml.startElement( "Section" ) - .writeAttribute( "name", sectionName ) + .writeAttribute( "name", trim( sectionName ) ) .writeAttribute( "description", description ); } } @@ -7137,7 +7127,7 @@ namespace Catch { } virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) { - m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.name ); + m_xml.startElement( "TestCase" ).writeAttribute( "name", trim( testInfo.name ) ); m_currentTestSuccess = true; } @@ -7268,7 +7258,7 @@ namespace Catch { writeGroup( *m_testGroups.back(), suiteTime ); } - virtual void testRunEnded() { + virtual void testRunEndedCumulative() { xml.endElement(); }