added json for SPF_GetGCovInfo pass
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2414"
|
#define VERSION_SPF "2415"
|
||||||
|
|||||||
@@ -2253,17 +2253,27 @@ int SPF_GetGCovInfo(void*& context, int winHandler, short *options, short *projN
|
|||||||
{
|
{
|
||||||
runPassesForVisualizer(projName, { GCOV_PARSER });
|
runPassesForVisualizer(projName, { GCOV_PARSER });
|
||||||
|
|
||||||
string resVal = "";
|
json gcov_array = json::array();
|
||||||
bool first = true;
|
for (auto& byFile : gCovInfo)
|
||||||
for (auto &byFile : gCovInfo)
|
|
||||||
{
|
{
|
||||||
if (!first)
|
json fileGCov;
|
||||||
resVal += "@";
|
fileGCov["file"] = byFile.first;
|
||||||
resVal += byFile.first + "@";
|
|
||||||
for (auto &elem : byFile.second)
|
json info_array = json::array();
|
||||||
resVal += to_string(elem.first) + " " + to_string(elem.second.getExecutedCount()) + " ";
|
for (auto& elem : byFile.second)
|
||||||
first = false;
|
{
|
||||||
|
info_array["line"] = elem.first;
|
||||||
|
info_array["execution"] = elem.second.getExecutedCount();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
fileGCov["lines"] = info_array;
|
||||||
|
|
||||||
|
gcov_array.push_back(fileGCov);
|
||||||
|
}
|
||||||
|
|
||||||
|
json allGCov;
|
||||||
|
allGCov["allGCov"] = gcov_array;
|
||||||
|
string resVal = allGCov.dump();
|
||||||
|
|
||||||
copyStringToShort(result, resVal);
|
copyStringToShort(result, resVal);
|
||||||
retSize = (int)resVal.size();
|
retSize = (int)resVal.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user