MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / Merge

Method Merge

CppCoverage/CoverageDataMerger.cpp:138–156  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

136
137 //-------------------------------------------------------------------------
138 Plugin::CoverageData CoverageDataMerger::Merge(
139 const std::vector<Plugin::CoverageData>& coverageDataCollection) const
140 {
141 auto coverageData = CreateCoverageData(coverageDataCollection);
142
143 std::map<fs::path, std::vector<Plugin::ModuleCoverage*>> modulesByPath =
144 GroupChildrenByKey<Plugin::CoverageData, fs::path, Plugin::ModuleCoverage>(
145 coverageDataCollection,
146 [](const Plugin::CoverageData& data) -> const Plugin::CoverageData::T_ModuleCoverageCollection& { return data.GetModules(); },
147 [](const Plugin::ModuleCoverage& module) -> const fs::path& { return module.GetPath(); });
148
149 for (const auto& pair : modulesByPath)
150 {
151 auto& module = coverageData.AddModule(pair.first);
152 FillModule(module, pair.second);
153 }
154
155 return coverageData;
156 }
157
158 //-------------------------------------------------------------------------
159 void CoverageDataMerger::MergeFileCoverage(Plugin::CoverageData& coverageData) const

Callers 4

TEST_FFunction · 0.80
TESTFunction · 0.80
TESTFunction · 0.80
RunFunction · 0.80

Calls 3

CreateCoverageDataFunction · 0.85
FillModuleFunction · 0.85
AddModuleMethod · 0.80

Tested by 3

TEST_FFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64