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") {}
This commit is contained in:
Igor Akhmetov 2016-08-30 10:54:02 +01:00
parent 35f510545d
commit 02c7e41c7c
1 changed files with 1 additions and 1 deletions

View File

@ -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();