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

Include suite name in junit classname attrib for grouping in jenkins

Jenkins groups junit test results by loosely interpreting the
classname attribute of the <testcase> element as a package-qualified
java class name such as java.util.String. It ignores the <testsuite>
elements in the xml. To organize test results we therefore need to
embed the suite name in the classname attribute as if it was a java
package name.

Fixes #922.
Commit
69ff7fcf4243e2b874dda9a8ab34993c31c879f1
Author
Thomas Sondergaard ·
Parents
a6b03031ba56

Files · Download .tar.gz

Changes

 include/reporters/catch_reporter_junit.hpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp
index 2b5a9bd5..5ade59b5 100644
--- a/include/reporters/catch_reporter_junit.hpp
+++ b/include/reporters/catch_reporter_junit.hpp
@@ -150,6 +150,10 @@ namespace Catch {
                 if ( className.empty() )
                     className = "global";
             }
+
+            if ( !m_config->name().empty() )
+                className = m_config->name() + "." + className;
+
             writeSection( className, "", rootSection );
         }