Opened 7 years ago
Closed 7 years ago
#11983 closed Bugs (fixed)
Boost Test XML Report contains unescaped XML characters
Reported by: | Owned by: | Raffi Enficiaud | |
---|---|---|---|
Milestone: | Boost 1.61.0 | Component: | test |
Version: | Boost 1.60.0 | Severity: | Problem |
Keywords: | XML, Test, Report | Cc: |
Description
I've encountered problems with the boost test reports in XML format. They contain unescaped characters ("<" and ">") in the TestCase name attribute for template tests. Here is a minimal example:
#define BOOST_TEST_MODULE huhu #include <boost/test/included/unit_test.hpp> #include <boost/test/test_case_template.hpp> #include <boost/mpl/list.hpp> typedef boost::mpl::list<int> types; BOOST_AUTO_TEST_CASE_TEMPLATE( test, Type, types ) {}
When running with --report_format=XML --report_level=detailed
, this will include the following in the XML report:
<TestCase name="test<i>" result="passed"...
The "<" and ">" characters inside the name attribute must be escaped according to the XML specifications.
I verified, that boost versions 1.53, 1.54 and 1.59 correctly escaped those characters. Interestingly , the unescaped characters appear in the XML report only. The XML logger is not affected for all boost versions including 1.60. When running with --log_format=XML --log_level=all
any boost test version correctly prints
<TestCase name="test<i>" ...
Change History (4)
comment:1 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 7 years ago
Milestone: | To Be Determined → Boost 1.61.0 |
---|
comment:3 by , 7 years ago
comment:4 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Merged to master rev 6a3a616
Fixed in branch topic/trac-11983-xml-escape-in-report