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 catchorg#1899
  • Loading branch information
horenmar committed Jul 12, 2020
1 parent 8b5f6e2 commit f3fe2dc
Show file tree
Hide file tree
Showing 2 changed files with 621 additions and 616 deletions.
5 changes: 5 additions & 0 deletions src/catch2/reporters/catch_reporter_junit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,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 f3fe2dc

Please sign in to comment.