CumulativeReporterBase stores TestRunNodes directly

This commit is contained in:
Martin Hořeňovský 2020-11-26 09:43:23 +01:00
parent e5ccb79bf8
commit b10a19545b
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
2 changed files with 3 additions and 4 deletions

View File

@ -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();
}

View File

@ -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;