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

Add OverallResultsCases element to XML reporter

Commit
7f5884016313989fd52a09a4c030fa441d3fd99a
Author
Ryan Pavlik ·
Committer
Martin Hořeňovský
Parents
3b0f8c7ff0df

Files · Download .tar.gz

Changes

 src/catch2/reporters/catch_reporter_xml.cpp  | 8 ++++++++
 tests/SelfTest/Baselines/xml.sw.approved.txt | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/src/catch2/reporters/catch_reporter_xml.cpp b/src/catch2/reporters/catch_reporter_xml.cpp
index 06615df5..b7712ec7 100644
--- a/src/catch2/reporters/catch_reporter_xml.cpp
+++ b/src/catch2/reporters/catch_reporter_xml.cpp
@@ -206,6 +206,10 @@ namespace Catch {
             .writeAttribute( "successes", testGroupStats.totals.assertions.passed )
             .writeAttribute( "failures", testGroupStats.totals.assertions.failed )
             .writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk );
+        m_xml.scopedElement( "OverallResultsCases")
+            .writeAttribute( "successes", testGroupStats.totals.testCases.passed )
+            .writeAttribute( "failures", testGroupStats.totals.testCases.failed )
+            .writeAttribute( "expectedFailures", testGroupStats.totals.testCases.failedButOk );
         m_xml.endElement();
     }
 
@@ -215,6 +219,10 @@ namespace Catch {
             .writeAttribute( "successes", testRunStats.totals.assertions.passed )
             .writeAttribute( "failures", testRunStats.totals.assertions.failed )
             .writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk );
+        m_xml.scopedElement( "OverallResultsCases")
+            .writeAttribute( "successes", testRunStats.totals.testCases.passed )
+            .writeAttribute( "failures", testRunStats.totals.testCases.failed )
+            .writeAttribute( "expectedFailures", testRunStats.totals.testCases.failedButOk );
         m_xml.endElement();
     }
 
diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt
index b5ac74ab..4bd9ca3d 100644
--- a/tests/SelfTest/Baselines/xml.sw.approved.txt
+++ b/tests/SelfTest/Baselines/xml.sw.approved.txt
@@ -18176,6 +18176,8 @@ loose text artifact
       <OverallResult success="true"/>
     </TestCase>
     <OverallResults successes="1789" failures="149" expectedFailures="21"/>
+    <OverallResultsCases successes="253" failures="86" expectedFailures="4"/>
   </Group>
   <OverallResults successes="1789" failures="148" expectedFailures="21"/>
+  <OverallResultsCases successes="253" failures="86" expectedFailures="4"/>
 </Catch>