From 17686ba5713931148bfa45b719a1a51756957fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathaniel=20Dos=C3=A9?= Date: Thu, 31 Jan 2019 22:03:41 +0100 Subject: [PATCH] junit reporter reports random seed (--rng-seed) Fixes #1520 --- include/reporters/catch_reporter_junit.cpp | 7 +++++++ projects/SelfTest/Baselines/junit.sw.approved.txt | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/reporters/catch_reporter_junit.cpp b/include/reporters/catch_reporter_junit.cpp index 03dc35c1..7e97ee31 100644 --- a/include/reporters/catch_reporter_junit.cpp +++ b/include/reporters/catch_reporter_junit.cpp @@ -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 ) { diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index a245a37a..77ea5697 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,6 +1,9 @@ - + + + + +loose text artifact