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

Function SetCoverageAttributes

Exporter/CoberturaExporter.cpp:114–128  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

112
113 //-------------------------------------------------------------------------
114 void SetCoverageAttributes(property_tree::wptree& coverageTree,
115 const CppCoverage::CoverageRate& coverageRate)
116 {
117 coverageTree.put(L"<xmlattr>.branches-covered", 0);
118 coverageTree.put(L"<xmlattr>.branches-valid", 0);
119
120 auto now = std::chrono::system_clock::now();
121 auto timestamp = std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count();
122 coverageTree.put(L"<xmlattr>.timestamp", timestamp);
123 coverageTree.put(L"<xmlattr>.lines-covered",
124 coverageRate.GetExecutedLinesCount());
125 coverageTree.put(L"<xmlattr>.lines-valid",
126 coverageRate.GetTotalLinesCount());
127 coverageTree.put(L"<xmlattr>.version", 0);
128 }
129
130 //-------------------------------------------------------------------------
131 void FillCoverageTree(

Callers 1

FillCoverageTreeFunction · 0.85

Calls 2

GetExecutedLinesCountMethod · 0.80
GetTotalLinesCountMethod · 0.80

Tested by

no test coverage detected