mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Cleanup reporting of rng seed in existing reporters
This commit is contained in:
parent
ed1f343a41
commit
1d9696d22d
@ -520,8 +520,7 @@ void ConsoleReporter::lazyPrintRunInfo() {
|
|||||||
<< " is a Catch v" << libraryVersion() << " host application.\n"
|
<< " is a Catch v" << libraryVersion() << " host application.\n"
|
||||||
<< "Run with -? for options\n\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;
|
currentTestRunInfo.used = true;
|
||||||
}
|
}
|
||||||
|
@ -114,19 +114,17 @@ namespace Catch {
|
|||||||
xml.writeAttribute( "time"_sr, suiteTime );
|
xml.writeAttribute( "time"_sr, suiteTime );
|
||||||
xml.writeAttribute( "timestamp"_sr, getCurrentTimestamp() );
|
xml.writeAttribute( "timestamp"_sr, getCurrentTimestamp() );
|
||||||
|
|
||||||
// Write properties if there are any
|
// Write properties
|
||||||
if (m_config->hasTestFilters() || m_config->rngSeed() != 0) {
|
{
|
||||||
auto properties = xml.scopedElement("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()) {
|
if (m_config->hasTestFilters()) {
|
||||||
xml.scopedElement("property")
|
xml.scopedElement("property")
|
||||||
.writeAttribute("name"_sr, "filters"_sr)
|
.writeAttribute("name"_sr, "filters"_sr)
|
||||||
.writeAttribute("value"_sr, serializeFilters(m_config->getTestsOrTags()));
|
.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
|
// Write test cases
|
||||||
|
@ -51,14 +51,11 @@ namespace Catch {
|
|||||||
std::string stylesheetRef = getStylesheetRef();
|
std::string stylesheetRef = getStylesheetRef();
|
||||||
if( !stylesheetRef.empty() )
|
if( !stylesheetRef.empty() )
|
||||||
m_xml.writeStylesheetRef( stylesheetRef );
|
m_xml.writeStylesheetRef( stylesheetRef );
|
||||||
m_xml.startElement( "Catch2TestRun" );
|
m_xml.startElement("Catch2TestRun")
|
||||||
if( !m_config->name().empty() )
|
.writeAttribute("name"_sr, m_config->name())
|
||||||
m_xml.writeAttribute( "name"_sr, m_config->name() );
|
.writeAttribute("rng-seed"_sr, m_config->rngSeed());
|
||||||
if (m_config->testSpec().hasFilters())
|
if (m_config->testSpec().hasFilters())
|
||||||
m_xml.writeAttribute( "filters"_sr, serializeFilters( m_config->getTestsOrTags() ) );
|
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 ) {
|
void XmlReporter::testCaseStarting( TestCaseInfo const& testInfo ) {
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
>
|
>
|
||||||
<testsuite name="<exe-name>" errors="17" failures="129" tests="2127" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
<testsuite name="<exe-name>" errors="17" failures="129" tests="2127" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/>
|
|
||||||
<property name="random-seed" value="1"/>
|
<property name="random-seed" value="1"/>
|
||||||
|
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/>
|
||||||
</properties>
|
</properties>
|
||||||
<testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}" status="run"/>
|
||||||
<testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}" status="run"/>
|
<testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}" status="run"/>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Catch2TestRun name="<exe-name>" filters="~[!nonportable]~[!benchmark]~[approvals] *">
|
<Catch2TestRun name="<exe-name>" rng-seed="1" filters="~[!nonportable]~[!benchmark]~[approvals] *">
|
||||||
<Randomness seed="1"/>
|
|
||||||
<TestCase name="# A test name that starts with a #" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
|
<TestCase name="# A test name that starts with a #" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
|
Loading…
Reference in New Issue
Block a user