Permalink
Browse files

junit reporter reports random seed (--rng-seed)

Fixes #1520
  • Loading branch information...
dosena authored and JoeyGrajciar committed Jan 31, 2019
1 parent d75e9b3 commit 17686ba5713931148bfa45b719a1a51756957fa8
Showing with 12 additions and 2 deletions.
  1. +7 −0 include/reporters/catch_reporter_junit.cpp
  2. +5 −2 projects/SelfTest/Baselines/junit.sw.approved.txt
@@ -76,6 +76,13 @@ namespace Catch {
void JunitReporter::testRunStarting( TestRunInfo const& runInfo ) {
CumulativeReporterBase::testRunStarting( runInfo );
xml.startElement( "testsuites" );
if( m_config->rngSeed() != 0 ) {
xml.startElement( "properties" );
xml.scopedElement( "property" )
.writeAttribute( "name", "random-seed" )
.writeAttribute( "value", m_config->rngSeed() );
xml.endElement();
}
}

void JunitReporter::testGroupStarting( GroupInfo const& groupInfo ) {
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
<testsuites>
<properties>
<property name="random-seed" value="1"/>
</properties>
loose text artifact
<testsuite name="<exe-name>" errors="17" failures="113" tests="1312" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/>
<testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}"/>

0 comments on commit 17686ba

Please sign in to comment.