Skip to content

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 #1899
  • Loading branch information
horenmar committed May 15, 2020
1 parent f764ee3 commit f133277
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 f133277

Please sign in to comment.