Modify

Ticket #11983 (closed Bugs: fixed)

Opened 14 months ago

Last modified 13 months ago

Boost Test XML Report contains unescaped XML characters

Reported by: m8mble <m8mble@…> Owned by: renficiaud
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&lt;i&gt;" ...

Attachments

Change History

comment:1 Changed 13 months ago by renficiaud

  • Owner changed from rogeeff to renficiaud
  • Status changed from new to assigned

comment:2 Changed 13 months ago by renficiaud

  • Milestone changed from To Be Determined to Boost 1.61.0

comment:3 Changed 13 months ago by renficiaud

Fixed in branch topic/trac-11983-xml-escape-in-report

comment:4 Changed 13 months ago by renficiaud

  • Status changed from assigned to closed
  • Resolution set to fixed

Merged to master rev 6a3a616

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.