Skip to content

JUnit reporter produces invalid XML #567

Open
@R2RT

Description

@R2RT

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions