mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Don't indent stdout/ stderr in JUnit reporter
This commit is contained in:
parent
2846367109
commit
37f3820747
@ -34,8 +34,8 @@ namespace Catch {
|
|||||||
m_writer->endElement();
|
m_writer->endElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopedElement& writeText( const std::string& text ) {
|
ScopedElement& writeText( const std::string& text, bool indent = true ) {
|
||||||
m_writer->writeText( text );
|
m_writer->writeText( text, indent );
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,11 +131,11 @@ namespace Catch {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
XmlWriter& writeText( const std::string& text ) {
|
XmlWriter& writeText( const std::string& text, bool indent = true ) {
|
||||||
if( !text.empty() ){
|
if( !text.empty() ){
|
||||||
bool tagWasOpen = m_tagIsOpen;
|
bool tagWasOpen = m_tagIsOpen;
|
||||||
ensureTagClosed();
|
ensureTagClosed();
|
||||||
if( tagWasOpen )
|
if( tagWasOpen && indent )
|
||||||
stream() << m_indent;
|
stream() << m_indent;
|
||||||
writeEncodedText( text );
|
writeEncodedText( text );
|
||||||
m_needsNewline = true;
|
m_needsNewline = true;
|
||||||
|
@ -187,8 +187,8 @@ namespace Catch {
|
|||||||
OutputTestCases( xml, *it );
|
OutputTestCases( xml, *it );
|
||||||
}
|
}
|
||||||
|
|
||||||
xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ) );
|
xml.scopedElement( "system-out" ).writeText( trim( m_stdOut.str() ), false );
|
||||||
xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ) );
|
xml.scopedElement( "system-err" ).writeText( trim( m_stdErr.str() ), false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,10 +206,10 @@ namespace Catch {
|
|||||||
|
|
||||||
std::string stdOut = trim( it->m_stdOut );
|
std::string stdOut = trim( it->m_stdOut );
|
||||||
if( !stdOut.empty() )
|
if( !stdOut.empty() )
|
||||||
xml.scopedElement( "system-out" ).writeText( stdOut );
|
xml.scopedElement( "system-out" ).writeText( stdOut, false );
|
||||||
std::string stdErr = trim( it->m_stdErr );
|
std::string stdErr = trim( it->m_stdErr );
|
||||||
if( !stdErr.empty() )
|
if( !stdErr.empty() )
|
||||||
xml.scopedElement( "system-err" ).writeText( stdErr );
|
xml.scopedElement( "system-err" ).writeText( stdErr, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user