Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Add status attribute to JUnit's section reporting
Browse files Browse the repository at this point in the history
This brings our output inline with GTest's. We do not handle skipped
tests properly, but that should be currently less important than
having the attribute exist with proper value for non-skipped tests.

Thanks @joda-01.

Closes catchorg#1899
  • Loading branch information
horenmar authored and nitnelave committed May 25, 2020
1 parent 3c59f6e commit cbef38b
Show file tree
Hide file tree
Showing 2 changed files with 566 additions and 561 deletions.
5 changes: 5 additions & 0 deletions include/reporters/catch_reporter_junit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ namespace Catch {
xml.writeAttribute( "name", name );
}
xml.writeAttribute( "time", ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) );
// This is not ideal, but it should be enough to mimic gtest's
// junit output.
// Ideally the JUnit reporter would also handle `skipTest`
// events and write those out appropriately.
xml.writeAttribute( "status", "run" );

writeAssertions( sectionNode );

Expand Down
Loading

0 comments on commit cbef38b

Please sign in to comment.