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

Consistent junit reporting regardless of internal SECTIONS

Change it so the classname attribute on the <testcase> element is the
test fixture name or "global" regardless of whether the TEST_CASE
contains SECTIONs. This way the output is not changed substantially,
just because a SECTION is added to a TEST_CASE.
Commit
a64a0c6f06bd766896c84cbad5559454bbf9b84e
Author
Thomas Sondergaard ·
Parents
377c9a746d16

Files · Download .tar.gz

Changes

 include/reporters/catch_reporter_junit.hpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp
index a671c68f..c8f1238e 100644
--- a/include/reporters/catch_reporter_junit.hpp
+++ b/include/reporters/catch_reporter_junit.hpp
@@ -139,8 +139,7 @@ namespace Catch {
             std::string className = stats.testInfo.className;
 
             if( className.empty() ) {
-                if( rootSection.childSections.empty() )
-                    className = "global";
+                className = "global";
             }
             writeSection( className, "", rootSection );
         }