mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-04 14:25:40 +02:00
Cleanup reporting of rng seed in existing reporters
This commit is contained in:
@@ -520,8 +520,7 @@ void ConsoleReporter::lazyPrintRunInfo() {
|
||||
<< " is a Catch v" << libraryVersion() << " host application.\n"
|
||||
<< "Run with -? for options\n\n";
|
||||
|
||||
if (m_config->rngSeed() != 0)
|
||||
stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n";
|
||||
stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n";
|
||||
|
||||
currentTestRunInfo.used = true;
|
||||
}
|
||||
|
@@ -114,19 +114,17 @@ namespace Catch {
|
||||
xml.writeAttribute( "time"_sr, suiteTime );
|
||||
xml.writeAttribute( "timestamp"_sr, getCurrentTimestamp() );
|
||||
|
||||
// Write properties if there are any
|
||||
if (m_config->hasTestFilters() || m_config->rngSeed() != 0) {
|
||||
// Write properties
|
||||
{
|
||||
auto properties = xml.scopedElement("properties");
|
||||
xml.scopedElement("property")
|
||||
.writeAttribute("name"_sr, "random-seed"_sr)
|
||||
.writeAttribute("value"_sr, m_config->rngSeed());
|
||||
if (m_config->hasTestFilters()) {
|
||||
xml.scopedElement("property")
|
||||
.writeAttribute("name"_sr, "filters"_sr)
|
||||
.writeAttribute("value"_sr, serializeFilters(m_config->getTestsOrTags()));
|
||||
}
|
||||
if (m_config->rngSeed() != 0) {
|
||||
xml.scopedElement("property")
|
||||
.writeAttribute("name"_sr, "random-seed"_sr)
|
||||
.writeAttribute("value"_sr, m_config->rngSeed());
|
||||
}
|
||||
}
|
||||
|
||||
// Write test cases
|
||||
|
@@ -51,14 +51,11 @@ namespace Catch {
|
||||
std::string stylesheetRef = getStylesheetRef();
|
||||
if( !stylesheetRef.empty() )
|
||||
m_xml.writeStylesheetRef( stylesheetRef );
|
||||
m_xml.startElement( "Catch2TestRun" );
|
||||
if( !m_config->name().empty() )
|
||||
m_xml.writeAttribute( "name"_sr, m_config->name() );
|
||||
m_xml.startElement("Catch2TestRun")
|
||||
.writeAttribute("name"_sr, m_config->name())
|
||||
.writeAttribute("rng-seed"_sr, m_config->rngSeed());
|
||||
if (m_config->testSpec().hasFilters())
|
||||
m_xml.writeAttribute( "filters"_sr, serializeFilters( m_config->getTestsOrTags() ) );
|
||||
if( m_config->rngSeed() != 0 )
|
||||
m_xml.scopedElement( "Randomness" )
|
||||
.writeAttribute( "seed"_sr, m_config->rngSeed() );
|
||||
}
|
||||
|
||||
void XmlReporter::testCaseStarting( TestCaseInfo const& testInfo ) {
|
||||
|
Reference in New Issue
Block a user