Opened 7 years ago
Closed 5 years ago
#11962 closed Bugs (fixed)
BOOST_TEST_MESSAGE in fixture constructor - invalid XML
Reported by: | Owned by: | Raffi Enficiaud | |
---|---|---|---|
Milestone: | Boost 1.65.0 | Component: | test |
Version: | Boost 1.61.0 | Severity: | Problem |
Keywords: | BOOST_TEST_MESSAGE XML | Cc: | federico.prades@… |
Description
I came across an issue with our global fixture using BOOST_TEST_MESSAGE. The resulting XML file in --output_format=XML --log_level=all mode has the message, but not wrapped in the
<TestLog> ... </TestLog>
scope. In turn xsltproc would break on this, trying to convert to JUnit. I think it would be better for the BOOST_TEST_MESSAGE to either be silently dropped, or perhaps buffered, or TestLog XML tag should be forced.
Using boost 1.59.0 here.
Change History (11)
comment:1 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 7 years ago
Milestone: | Boost 1.61.0 → To Be Determined |
---|
comment:5 by , 6 years ago
The problem here is that global fixture are convenient for changing the logger at runtime, so they must be executed before the logger starts.
I am thinking of a fix. Do you have a snippet?
comment:6 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
Digging deeper: this is related to #5563
comment:7 by , 6 years ago
Status: | new → assigned |
---|
comment:8 by , 6 years ago
Cc: | added |
---|
comment:9 by , 5 years ago
Milestone: | To Be Determined → Boost 1.65.0 |
---|
comment:10 by , 5 years ago
Hi,
I just pushed a fix on the develop branch (rev ea9d9b9a8ea3f9aceb71cce41d48c820f05b2fdc
) that addresses the issue by adding a dedicated macro for global fixtures BOOST_TEST_GLOBAL_FIXTURE
and decouples it from the global initialization (that now goes to BOOST_TEST_GLOBAL_INITIALIZATION
).
The global init cannot receive any logs, while the global fixture can. It should solve your issue, and it would be nice if you give a try.
comment:11 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In master, rev 3d13638c412ac357f178e99a99bf44dfd756c057
Merged to master rev 6a3a616