diff options
| author | Martin Hořeňovský | 2020-05-15 21:00:19 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-07-12 21:22:15 +0200 |
| commit | f3fe2dcb110a2fbdf55ff02f2dfeea072e782cdb (patch) | |
| tree | ba702b2ba96ff9a7258ddcab8f3f15b1bbd852be /src | |
| parent | 8b5f6e26d3e8211be838e98602b948a6f2439a71 (diff) | |
| download | catch3-f3fe2dcb110a2fbdf55ff02f2dfeea072e782cdb.tar.gz | |
Add status attribute to JUnit's section reporting
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/catch2/reporters/catch_reporter_junit.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/catch2/reporters/catch_reporter_junit.cpp b/src/catch2/reporters/catch_reporter_junit.cpp index c18b03e8..7e1d6829 100644 --- a/src/catch2/reporters/catch_reporter_junit.cpp +++ b/src/catch2/reporters/catch_reporter_junit.cpp @@ -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 ); |