id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 3978,"Failed to completely redirect TestLog to file, bugfix appended",phu@…,Gennadiy Rozental,"Hi when using the following suggested global fixture with XML format, the final tag gets lost and ends up in cout instead of the file. 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.) used fixture: {{{ 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 ); }}} applied changes (on version 1.40, but 1.42 is still the same): {{{ 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->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)->test_finish(); } s_frk_impl().m_test_in_progress = was_in_progress; }}} ",Bugs,closed,Boost 1.59.0,test,Boost 1.42.0,Problem,fixed,,