From a64a0c6f06bd766896c84cbad5559454bbf9b84e Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Tue, 30 May 2017 17:10:14 +0200 Subject: [PATCH] Consistent junit reporting regardless of internal SECTIONS Change it so the classname attribute on the 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. --- 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 ); }