ut icon indicating copy to clipboard operation
ut copied to clipboard

JUnit reporter produces invalid XML

Open R2RT opened this issue 2 years ago • 0 comments

Expected Behavior

Produced XML is valid and conforms JUnit format

Actual Behavior

Example XML

<?xml version="1.0" encoding="UTF-8"?>
<testsuites classname="example\Debug\boost_ut_hello_world.exe" name="global" tests="1" errors="0" failures="0" skipped="0" time="0" version="119" />
 <testcase classname="global" name="hello world" tests="3" errors="0" failures="0" skipped="0" time="0" status="PASSED" />
</testsuites>

XML is corrupted:

  • <testsuites /> is closed in same line it is opened (finishes with /> not >)
  • there can be multiple root elements (one per executed suite)

And does not conform JUnit:

  • there is one missing layer: JUnit uses testsuites -> testsuite -> testcase
  • failed/skipped tests should be marked with nested <failure/>/<skipped/> tags, not status (at least to get it working on Gitlab)

Steps to Reproduce the Problem

  1. Run hello_world example with --reporter junit

Specifications

  • Version: master
  • Platform: Agnostic
  • Subsystem: Reporter

I am willing to contribute and fix it, but firstly I must get stable argument parsing on Windows.

R2RT avatar Jun 13 '23 21:06 R2RT