diff --git a/src/Utils/version.h b/src/Utils/version.h index f7a00de..611a726 100644 --- a/src/Utils/version.h +++ b/src/Utils/version.h @@ -1,3 +1,3 @@ #pragma once -#define VERSION_SPF "2414" +#define VERSION_SPF "2415" diff --git a/src/VisualizerCalls/get_information.cpp b/src/VisualizerCalls/get_information.cpp index 40ef3de..f4c76e4 100644 --- a/src/VisualizerCalls/get_information.cpp +++ b/src/VisualizerCalls/get_information.cpp @@ -2253,18 +2253,28 @@ 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(); }