Boost C++ Libraries: Ticket #3978: Failed to completely redirect TestLog to file, bugfix appended https://svn.boost.org/trac10/ticket/3978 <p> Hi </p> <p> when using the following suggested global fixture with XML format, the final tag &lt;<a class="missing wiki">/TestLog</a>&gt; gets lost and ends up in cout instead of the file. </p> <p> I tracked the bug and suggest the following patch, which fixed the problem. (The problem is, that the global fixture is applied before the logger but is removed before the logger is finished.) </p> <p> used fixture: </p> <pre class="wiki">struct TestSuiteConfig { TestSuiteConfig() : test_log( "testresults.log" ) { boost::unit_test::unit_test_log.set_format( boost::unit_test::XML ); boost::unit_test::unit_test_log.set_stream( test_log ); } ~TestSuiteConfig() { boost::unit_test::unit_test_log.set_stream( std::cout ); } std::ofstream test_log; }; BOOST_GLOBAL_FIXTURE( TestSuiteConfig ); </pre><p> applied changes (on version 1.40, but 1.42 is still the same): </p> <pre class="wiki">Index: boost/test/impl/framework.ipp =================================================================== --- framework.ipp (revision 801) +++ framework.ipp (revision 802) @@ -445,8 +445,9 @@ } if( call_start_finish ) { - BOOST_TEST_FOREACH( test_observer*, to, s_frk_impl().m_observers ) - to-&gt;test_finish(); + for( framework_impl::observer_store::reverse_iterator to = s_frk_impl().m_observers.rbegin(); to != s_frk_impl().m_observers.rend(); ++to) + (*to)-&gt;test_finish(); } s_frk_impl().m_test_in_progress = was_in_progress; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3978 Trac 1.4.3 Steven Watanabe Fri, 11 Jun 2010 15:18:49 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3978#comment:1 https://svn.boost.org/trac10/ticket/3978#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62805" title="Call test_finish/test_unit_finish in the reverse order from ...">[62805]</a>) Call test_finish/test_unit_finish in the reverse order from test_start/test_unit_start. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3978" title="#3978: Bugs: Failed to completely redirect TestLog to file, bugfix appended (closed: fixed)">#3978</a> </p> Ticket Philipp Huber <phu@…> Fri, 13 Aug 2010 11:11:06 GMT <link>https://svn.boost.org/trac10/ticket/3978#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3978#comment:2</guid> <description> <p> somehow, that fix has not made it into boost 1.43, hope it will be in in 1.44. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Tue, 07 Jul 2015 08:13:31 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/3978#comment:3 https://svn.boost.org/trac10/ticket/3978#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.43.0</span> → <span class="trac-field-new">Boost 1.59.0</span> </li> </ul> Ticket