Boost C++ Libraries: Ticket #12452: XML log can contain unescaped characters from test output https://svn.boost.org/trac10/ticket/12452 <p> XML log format does not escape user test output, so the resulting XML file is not valid, e.g. </p> <pre class="wiki">BOOST_AUTO_TEST_CASE(test) { std::cout &lt;&lt; "&amp;"; } </pre><p> This issue makes it impossible to parse the output with standard XML parsers. </p> <p> A file log sink can be used to separate Boost.Test output from user output. Unfortunately, the XML reporter does not flush the output stream, so if a unit test runner wants to show test results as soon as they are available, the stderr sink is the only option. </p> <p> For comparison, the Catch unit test framework redirects cout and cerr and later prints escaped output inside a corresponding XML node. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12452 Trac 1.4.3 Raffi Enficiaud Tue, 13 Sep 2016 12:25:17 GMT <link>https://svn.boost.org/trac10/ticket/12452#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12452#comment:1</guid> <description> <p> If you want to have that output in the final XML, I suggest you using <code>BOOST_TEST_MESSAGE</code> instead (<a href="http://www.boost.org/doc/libs/1_61_0/libs/test/doc/html/boost_test/test_output/test_output_macro_message.html">see documentation here</a>). </p> <p> This is also what eg. Google test <a class="ext-link" href="https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md#logging-additional-information"><span class="icon">​</span>proposes</a>. </p> <p> In any case, if you mess with the logger output stream, then the output stream is likely to be invalid. </p> </description> <category>Ticket</category> </item> <item> <author>Igor Akhmetov <igor.akhmetov@…></author> <pubDate>Tue, 13 Sep 2016 12:51:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12452#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12452#comment:2</guid> <description> <p> I'm the author of the unit test runner in <a class="missing wiki">ReSharper</a> C++, so I'm actually providing an interface to Boost.Test. </p> <p> We can't use XML log format with Google Test, since it's not streaming, so we use the console reporter which is fairly easy to parse. In Boost.Test the XML reporter is streaming, but not flushing, so we use it with the stderr sink - the only problem is unescaped user output which the standard XML reader fails to parse, and we've got several user requests about this problem. </p> <p> Again, please take a look at how Catch handles that - it intercepts all user output and escapes it (e.g. in the JUnit reporter). Ideally I'd like Boost.Test to adopt the same approach. </p> </description> <category>Ticket</category> </item> </channel> </rss>