MCPcopy Create free account
hub / github.com/Samsung/UTopia / saveReport

Method saveReport

lib/generation/FuzzGenReporter.cpp:105–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void FuzzGenReporter::saveReport(std::string OutDir) const {
106 // Report Stats
107 Json::Value StatsJson = exportStatsJson();
108
109 // Report UT and API Information
110 Json::Value UTsJson = exportUTsReportJson();
111 Json::Value APIsJson = exportAPIsReportJson();
112
113 // Make FuzzGenReport Json
114 Json::Value FuzzGenReportJson;
115 FuzzGenReportJson["FuzzInputMutator"] = "ProtoBuf";
116 FuzzGenReportJson["UT"] = UTsJson;
117 FuzzGenReportJson["API"] = APIsJson;
118 for (std::string StatsField : StatsJson.getMemberNames()) {
119 FuzzGenReportJson[StatsField] = StatsJson[StatsField];
120 }
121
122 // Write FuzzGenReport Json File
123 Json::StreamWriterBuilder WBuilder;
124 std::string FuzzGenReportJsonStr = writeString(WBuilder, FuzzGenReportJson);
125 std::string ReportFilePath = OutDir + PATH_SEPARATOR + REPORT_FILENAME;
126 if (util::saveFile(ReportFilePath.c_str(), FuzzGenReportJsonStr.c_str())) {
127 llvm::outs() << "Write Report : " << ReportFilePath << "\n";
128 } else {
129 llvm::outs() << "[ERROR] Writing Report Failed: " << ReportFilePath << "\n";
130 }
131}
132
133Json::Value FuzzGenReporter::exportUTsReportJson() const {
134 Json::Value UTsJson = Json::Value(Json::arrayValue);

Callers 1

exportReportJsonMethod · 0.80

Calls 3

writeStringFunction · 0.85
saveFileFunction · 0.85
getMemberNamesMethod · 0.80

Tested by

no test coverage detected