Subject: | Filter/escape invalid XML chars |
The TAP output is put verbatim in <system-out>.
But not all characters are allowed in XML. From the XML specification:
http://www.w3.org/TR/xml/#charsets
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
This means that if the TAP output contains '\0' (I had this when using Test::More::is() to check binary data), the generated JUnit file currently is invalid. Consequence: Jenkins fails to load it (because its XML parser is strictly compliant) and the build is reported as "UNSTABLE".
TAP::Harness::JUnit should:
- filter the TAP output for invalid XML chars
- report an additional testcase that is a failure "invalid XML chars has been detected in TAP output" (rationale: we had to alter the TAP output, it would be better for the user to fix his tests)
--
Olivier Mengué - http://perlresume.org/DOLMEN