TextTest writes illegal char in xunit file CDATA section

Bug #1504043 reported by Magnus Lyckå
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TextTest
Fix Released
Undecided
Unassigned

Bug Description

TextTest seems to dump unfiltered (?) text into the CDATA sections of junit result files.

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="XXX" failures="1" tests="1" time="0" errors="0">
  <properties/>
  <testcase name="XXX" time="0" classname="XXX">
    <failure type="differences" message="stdout different(+)">
    <![CDATA[
...
Please don't allow e.g. form feed (#xC) here, since XML parsers will reject the file.
...
]]>

The following characters are allowed in CDATA ( as long as it's not ]]> ):
#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]

See http://www.w3.org/TR/REC-xml/#sec-cdata-sect and http://www.w3.org/TR/REC-xml/#NT-Char

Revision history for this message
Geoff Bache (geoff.bache) wrote :

Try to change to the following in the file texttestlib/default/batch/junitreport.py

def _longMessage(self, test):
        message = escape(test.state.freeText.replace("]]>", "END_MARKER"))
        return message

I believe you are also currently working in the same office as the original author of this code, who may be able to help further :)

Revision history for this message
Geoff Bache (geoff.bache) wrote :

Checked in the patch sent by Magnus this afternoon.

Changed in texttest:
status: New → Fix Committed
Changed in texttest:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.