Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPhil Nash2012-11-22 09:02:24 +0000
committerPhil Nash2012-11-22 09:02:24 +0000
commit37f3820747eb7fd4e1d937e100de6f5fafcdb83c (patch)
tree09ddba9c3b546fcf7341e48712b9c2a747180a3e
parent28463671094abb8387f71c6783cf7ee3a3722ede (diff)
downloadcatch3-37f3820747eb7fd4e1d937e100de6f5fafcdb83c.tar.gz
Don't indent stdout/ stderr in JUnit reporter
-rw-r--r--include/internal/catch_xmlwriter.hpp8
-rw-r--r--include/reporters/catch_reporter_junit.hpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/include/internal/catch_xmlwriter.hpp b/include/internal/catch_xmlwriter.hpp
index f929f601..98e827f4 100644
--- a/include/internal/catch_xmlwriter.hpp
+++ b/include/internal/catch_xmlwriter.hpp
@@ -34,8 +34,8 @@ namespace Catch {
m_writer->endElement();
}
- ScopedElement& writeText( const std::string& text ) {
- m_writer->writeText( text );
+ ScopedElement& writeText( const std::string& text, bool indent = true ) {
+ m_writer->writeText( text, indent );
return *this;
}
@@ -131,11 +131,11 @@ namespace Catch {
return *this;
}
- XmlWriter& writeText( const std::string& text ) {
+ XmlWriter& writeText( const std::string& text, bool indent = true ) {
if( !text.empty() ){
bool tagWasOpen = m_tagIsOpen;
ensureTagClosed();
- if( tagWasOpen )
+ if( tagWasOpen && indent )
stream() << m_indent;
writeEncodedText( text );
m_needsNewline = true;
diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp
index 39c6e92a..8fac30d1 100644
--- a/include/reporters/catch_reporter_junit.hpp
+++ b/include/reporters/catch_reporter_junit.hpp
@@ -187,8 +187,8 @@ namespace Catch {
OutputTestCases( xml, *it );
}
- xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ) );
- xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ) );
+ xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ), false );
+ xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ), false );
}
}
@@ -206,10 +206,10 @@ namespace Catch {
std::string stdOut = trim( it->m_stdOut );
if( !stdOut.empty() )
- xml.scopedElement( "system-out" ).writeText( stdOut );
+ xml.scopedElement( "system-out" ).writeText( stdOut, false );
std::string stdErr = trim( it->m_stdErr );
if( !stdErr.empty() )
- xml.scopedElement( "system-err" ).writeText( stdErr );
+ xml.scopedElement( "system-err" ).writeText( stdErr, false );
}
}