From 69ff7fcf4243e2b874dda9a8ab34993c31c879f1 Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Tue, 30 May 2017 21:40:28 +0200 Subject: [PATCH] Include suite name in junit classname attrib for grouping in jenkins Jenkins groups junit test results by loosely interpreting the classname attribute of the element as a package-qualified java class name such as java.util.String. It ignores the 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. --- 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 ); }