XML Reporter closes tag and flushes stream at end of TestCase and Section tags.

This fixes an issue where XML reports on stdout are broken by printf statements
This commit is contained in:
Phil Nash
2017-02-13 15:56:25 +00:00
parent bc68b9f454
commit 873ef276b6
7 changed files with 23 additions and 12 deletions

View File

@@ -211,6 +211,13 @@ namespace Catch {
return *this;
}
void ensureTagClosed() {
if( m_tagIsOpen ) {
m_os << ">" << std::endl;
m_tagIsOpen = false;
}
}
private:
XmlWriter( XmlWriter const& );
void operator=( XmlWriter const& );
@@ -219,13 +226,6 @@ namespace Catch {
m_os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
}
void ensureTagClosed() {
if( m_tagIsOpen ) {
m_os << ">" << std::endl;
m_tagIsOpen = false;
}
}
void newlineIfNecessary() {
if( m_needsNewline ) {
m_os << std::endl;