Boost logo

Boost Users :

Subject: [Boost-users] [Test] Calling BOOST_MESSAGE too early results in malformed xml output from Boost.Test
From: Martin Ba (0xcdcdcdcd_at_[hidden])
Date: 2014-12-18 04:03:43


Hi!

First, I'm on 1.44 and won't get around to test it on a newer version
any time soon, so I'll just throw it in anyway:

I've hit the case that when the executable running boost.test is calling
BOOST_MESSAGE from a BOOST_GLOBAL_FIXTURE, the message is generated
*before* the unit test runner is full initialized (the message "Running
## test cases..." is displayed *after* the Message).

When writing xml output, this means that the `<Message>`is generated
before the `<TestLog>` root, resulting in malformed xml.

I can fix this quite easily on my side, since I've [customized my logger
anyway][1], I'll just have to make sure
unit_test_log_formatter::log_start is always called first for the xml
case, but it's still a buggy thing imho.

cheers,
Martin

[1] :
http://stackoverflow.com/questions/26505229/how-to-log-boost-test-output-to-both-stdout-in-hrf-and-to-a-file-in-xml


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net