Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

CumulativeReporterBase stores TestRunNodes directly

Commit
b10a19545b55c78c517f0fe9dbb16d80e118d28b
Author
Martin Hořeňovský ·
Parents
e5ccb79bf865

Files · Download .tar.gz

Changes

 src/catch2/reporters/catch_reporter_cumulative_base.cpp | 5 ++---
 src/catch2/reporters/catch_reporter_cumulative_base.hpp | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.cpp b/src/catch2/reporters/catch_reporter_cumulative_base.cpp
index 740b1a32..67154d95 100644
--- a/src/catch2/reporters/catch_reporter_cumulative_base.cpp
+++ b/src/catch2/reporters/catch_reporter_cumulative_base.cpp
@@ -103,9 +103,8 @@ namespace Catch {
     }
 
     void CumulativeReporterBase::testRunEnded( TestRunStats const& testRunStats ) {
-        auto node = Detail::make_unique<TestRunNode>( testRunStats );
-        node->children.swap( m_testGroups );
-        m_testRuns.push_back( std::move(node) );
+        m_testRuns.emplace_back( testRunStats );
+        m_testRuns.back().children.swap( m_testGroups );
         testRunEndedCumulative();
     }
 
diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.hpp b/src/catch2/reporters/catch_reporter_cumulative_base.hpp
index 0df65aea..26c62ef5 100644
--- a/src/catch2/reporters/catch_reporter_cumulative_base.hpp
+++ b/src/catch2/reporters/catch_reporter_cumulative_base.hpp
@@ -73,7 +73,7 @@ namespace Catch {
         std::vector<std::shared_ptr<TestCaseNode>> m_testCases;
         std::vector<std::shared_ptr<TestGroupNode>> m_testGroups;
 
-        std::vector<Detail::unique_ptr<TestRunNode>> m_testRuns;
+        std::vector<TestRunNode> m_testRuns;
 
         std::shared_ptr<SectionNode> m_rootSection;
         SectionNode* m_deepestSection = nullptr;