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