added json for SPF_GetGCovInfo pass
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
#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 });
|
||||
|
||||
string resVal = "";
|
||||
bool first = true;
|
||||
for (auto &byFile : gCovInfo)
|
||||
json gcov_array = json::array();
|
||||
for (auto& byFile : gCovInfo)
|
||||
{
|
||||
if (!first)
|
||||
resVal += "@";
|
||||
resVal += byFile.first + "@";
|
||||
for (auto &elem : byFile.second)
|
||||
resVal += to_string(elem.first) + " " + to_string(elem.second.getExecutedCount()) + " ";
|
||||
first = false;
|
||||
json fileGCov;
|
||||
fileGCov["file"] = byFile.first;
|
||||
|
||||
json info_array = json::array();
|
||||
for (auto& elem : byFile.second)
|
||||
{
|
||||
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);
|
||||
retSize = (int)resVal.size();
|
||||
|
||||
Reference in New Issue
Block a user