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

Function WriteSourceRoots

Exporter/CoberturaExporter.cpp:92–111  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

90
91 //-------------------------------------------------------------------------
92 void WriteSourceRoots(
93 const Plugin::CoverageData& coverageData,
94 property_tree::wptree& coverageTree)
95 {
96 std::unordered_set<std::wstring> rootPaths;
97
98 for (const auto& module : coverageData.GetModules())
99 {
100 for (const auto& file : module->GetFiles())
101 {
102 const auto& path = file->GetPath();
103 rootPaths.insert(path.root_name().wstring());
104 }
105 }
106
107 auto& sourcesTree = AddChild(coverageTree, L"sources");
108
109 for (const auto& rootPath : rootPaths)
110 sourcesTree.add(L"source", rootPath);
111 }
112
113 //-------------------------------------------------------------------------
114 void SetCoverageAttributes(property_tree::wptree& coverageTree,

Callers 1

FillCoverageTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected