Skip to content

Commit

Permalink
Add version field to the XML reporter output
Browse files Browse the repository at this point in the history
We start at version 2, with version 1 being taken up by the output
from Catch2 v2.
  • Loading branch information
horenmar committed Nov 10, 2022
1 parent 066cc51 commit 943c6e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/catch2/reporters/catch_reporter_xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down
2 changes: 1 addition & 1 deletion tests/SelfTest/Baselines/xml.sw.approved.txt
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion tests/SelfTest/Baselines/xml.sw.multi.approved.txt
Original file line number Diff line number Diff line change
@@ -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>
Expand Down

0 comments on commit 943c6e3

Please sign in to comment.