From 02c7e41c7c1d38e26a5b323053d2a68ebe7338df Mon Sep 17 00:00:00 2001 From: Igor Akhmetov Date: Tue, 30 Aug 2016 10:54:02 +0100 Subject: [PATCH] Do not trim test case names in the XML reporter. SCENARIO does not add leading spaces to the test name (only BDD-style section names are modified), so the trimming is not necessary. But if the name is trimmed, it makes it harder to correlate the output of XML reporter with tests that have leading spaces in their name: e.g. these tests will have the same name attribute: TEST_CASE("Test") {} TEST_CASE(" Test") {} --- include/reporters/catch_reporter_xml.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index bbe8780b..000fba35 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -53,7 +53,7 @@ namespace Catch { virtual void testCaseStarting( TestCaseInfo const& testInfo ) CATCH_OVERRIDE { StreamingReporterBase::testCaseStarting(testInfo); - m_xml.startElement( "TestCase" ).writeAttribute( "name", trim( testInfo.name ) ); + m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.name ); if ( m_config->showDurations() == ShowDurations::Always ) m_testCaseTimer.start();