From d9b0a38f81df4bd5876888ba7937f5750b59b5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Tue, 3 May 2022 19:44:55 +0200 Subject: [PATCH] Report Catch2's version in the xml reporter output --- src/catch2/reporters/catch_reporter_xml.cpp | 4 +++- tests/SelfTest/Baselines/console.std.approved.txt | 2 +- tests/SelfTest/Baselines/console.sw.approved.txt | 2 +- tests/SelfTest/Baselines/console.sw.multi.approved.txt | 2 +- tests/SelfTest/Baselines/console.swa4.approved.txt | 2 +- tests/SelfTest/Baselines/xml.sw.approved.txt | 2 +- tests/SelfTest/Baselines/xml.sw.multi.approved.txt | 2 +- tools/scripts/approvalTests.py | 2 +- 8 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/catch2/reporters/catch_reporter_xml.cpp b/src/catch2/reporters/catch_reporter_xml.cpp index b34d7679..b8b93235 100644 --- a/src/catch2/reporters/catch_reporter_xml.cpp +++ b/src/catch2/reporters/catch_reporter_xml.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #if defined(_MSC_VER) #pragma warning(push) @@ -54,7 +55,8 @@ namespace Catch { m_xml.writeStylesheetRef( stylesheetRef ); m_xml.startElement("Catch2TestRun") .writeAttribute("name"_sr, m_config->name()) - .writeAttribute("rng-seed"_sr, m_config->rngSeed()); + .writeAttribute("rng-seed"_sr, m_config->rngSeed()) + .writeAttribute("catch2-version"_sr, libraryVersion()); if (m_config->testSpec().hasFilters()) m_xml.writeAttribute( "filters"_sr, serializeFilters( m_config->getTestsOrTags() ) ); } diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt index fd2bff6e..2f01bf6f 100644 --- a/tests/SelfTest/Baselines/console.std.approved.txt +++ b/tests/SelfTest/Baselines/console.std.approved.txt @@ -2,7 +2,7 @@ Filters: ~[!nonportable]~[!benchmark]~[approvals] * Randomness seeded to: 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - is a host application. + is a Catch2 v host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index acfbe42e..67cc096c 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -2,7 +2,7 @@ Filters: ~[!nonportable]~[!benchmark]~[approvals] * Randomness seeded to: 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - is a host application. + is a Catch2 v host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt index 1268daff..d8c521dd 100644 --- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -2,7 +2,7 @@ Filters: ~[!nonportable]~[!benchmark]~[approvals] * Randomness seeded to: 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - is a host application. + is a Catch2 v host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/tests/SelfTest/Baselines/console.swa4.approved.txt b/tests/SelfTest/Baselines/console.swa4.approved.txt index c25719d8..ede2d59c 100644 --- a/tests/SelfTest/Baselines/console.swa4.approved.txt +++ b/tests/SelfTest/Baselines/console.swa4.approved.txt @@ -2,7 +2,7 @@ Filters: ~[!nonportable]~[!benchmark]~[approvals] * Randomness seeded to: 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - is a host application. + is a Catch2 v host application. Run with -? for options ------------------------------------------------------------------------------- diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index 27dad165..6a8bf396 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -1,5 +1,5 @@ - + diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt index 40cca5e3..214a28dd 100644 --- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -1,5 +1,5 @@ - + diff --git a/tools/scripts/approvalTests.py b/tools/scripts/approvalTests.py index 0febe1cc..fbe5b0d6 100755 --- a/tools/scripts/approvalTests.py +++ b/tools/scripts/approvalTests.py @@ -34,7 +34,7 @@ hexParser = re.compile(r'\b(0[xX][0-9a-fA-F]+)\b') junitDurationsParser = re.compile(r' time="[0-9]+\.[0-9]{3}"') durationParser = re.compile(r''' duration=['"][0-9]+['"]''') timestampsParser = re.compile(r'\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}Z') -versionParser = re.compile(r'Catch2 v[0-9]+\.[0-9]+\.[0-9]+(-\w*\.[0-9]+)?') +versionParser = re.compile(r'[0-9]+\.[0-9]+\.[0-9]+(-\w*\.[0-9]+)?') nullParser = re.compile(r'\b(__null|nullptr)\b') exeNameParser = re.compile(r''' \b