Add version field to the XML reporter output

We start at version 2, with version 1 being taken up by the output
from Catch2 v2.
This commit is contained in:
Martin Hořeňovský 2022-11-10 12:02:59 +01:00
parent 066cc51ce6
commit 943c6e3dee
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
3 changed files with 3 additions and 2 deletions

View File

@ -56,6 +56,7 @@ namespace Catch {
m_xml.startElement("Catch2TestRun")
.writeAttribute("name"_sr, m_config->name())
.writeAttribute("rng-seed"_sr, m_config->rngSeed())
.writeAttribute("xml-format-version"_sr, 2)
.writeAttribute("catch2-version"_sr, libraryVersion());
if ( m_config->testSpec().hasFilters() ) {
m_xml.writeAttribute( "filters"_sr, m_config->testSpec() );

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Catch2TestRun name="<exe-name>" rng-seed="1" catch2-version="<version>" filters="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]">
<Catch2TestRun name="<exe-name>" rng-seed="1" xml-format-version="2" catch2-version="<version>" filters="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]">
<TestCase name="# A test name that starts with a #" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<OverallResult success="true"/>
</TestCase>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Catch2TestRun name="<exe-name>" rng-seed="1" catch2-version="<version>" filters="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]">
<Catch2TestRun name="<exe-name>" rng-seed="1" xml-format-version="2" catch2-version="<version>" filters="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]">
<TestCase name="# A test name that starts with a #" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<OverallResult success="true"/>
</TestCase>