Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Fix (hopefully) for #5 (reopened)

Adds name to JUnit reporter's testsuite element, even when running all tests.
Also removes redundant comment from the output.
Commit
ef60d54671981f86b0c94bd597f8acf8382b4ba2
Author
Phil Nash ·
Parents
be1cddb7ee0b

Files · Download .tar.gz

Changes

 include/internal/catch_version.hpp         |  2 +-
 include/reporters/catch_reporter_junit.hpp |  9 +++++----
 single_include/catch.hpp                   | 13 +++++++------
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp
index e7573191..9c293e77 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 = { 0, 9, 1, "integration" };
+    Version libraryVersion = { 0, 9, 2, "integration" };
 }
 
 #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED
diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp
index 93c48360..d9b1a47a 100644
--- a/include/reporters/catch_reporter_junit.hpp
+++ b/include/reporters/catch_reporter_junit.hpp
@@ -79,8 +79,11 @@ namespace Catch {
 
         virtual void StartTesting(){}
         
-        virtual void StartGroup( const std::string& groupName ) {            
-            m_statsForSuites.push_back( Stats( groupName ) );
+        virtual void StartGroup( const std::string& groupName ) {
+            if( groupName.empty() )
+                m_statsForSuites.push_back( Stats( "all tests" ) );
+            else
+                m_statsForSuites.push_back( Stats( groupName ) );
             m_currentStats = &m_statsForSuites.back();
         }
 
@@ -188,8 +191,6 @@ namespace Catch {
             std::vector<TestCaseStats>::const_iterator it = stats.m_testCaseStats.begin();
             std::vector<TestCaseStats>::const_iterator itEnd = stats.m_testCaseStats.end();
             for(; it != itEnd; ++it ) {
-                xml.writeBlankLine();
-                xml.writeComment( "Test case" );
                 
                 XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
                 xml.writeAttribute( "classname", it->m_className );
diff --git a/single_include/catch.hpp b/single_include/catch.hpp
index 7ea226ac..bade257f 100644
--- a/single_include/catch.hpp
+++ b/single_include/catch.hpp
@@ -1,6 +1,6 @@
 /*
- *  CATCH v0.9 build 1 (integration branch)
- *  Generated: 2012-11-15 22:13:35.214657
+ *  CATCH v0.9 build 2 (integration branch)
+ *  Generated: 2012-11-16 08:44:53.410120
  *  ----------------------------------------------------------
  *  This file has been merged from multiple headers. Please don't edit it directly
  *  Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
@@ -5375,7 +5375,7 @@ namespace Catch {
 namespace Catch {
 
     // These numbers are maintained by a script
-    Version libraryVersion = { 0, 9, 1, "integration" };
+    Version libraryVersion = { 0, 9, 2, "integration" };
 }
 
 // #included from: ../reporters/catch_reporter_basic.hpp
@@ -6148,7 +6148,10 @@ namespace Catch {
         virtual void StartTesting(){}
 
         virtual void StartGroup( const std::string& groupName ) {
-            m_statsForSuites.push_back( Stats( groupName ) );
+            if( groupName.empty() )
+                m_statsForSuites.push_back( Stats( "all tests" ) );
+            else
+                m_statsForSuites.push_back( Stats( groupName ) );
             m_currentStats = &m_statsForSuites.back();
         }
 
@@ -6256,8 +6259,6 @@ namespace Catch {
             std::vector<TestCaseStats>::const_iterator it = stats.m_testCaseStats.begin();
             std::vector<TestCaseStats>::const_iterator itEnd = stats.m_testCaseStats.end();
             for(; it != itEnd; ++it ) {
-                xml.writeBlankLine();
-                xml.writeComment( "Test case" );
 
                 XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
                 xml.writeAttribute( "classname", it->m_className );