| 43 | } |
| 44 | |
| 45 | bool UTAnalyzer::dump(std::string OutputFilePath) { |
| 46 | Json::Value Root; |
| 47 | for (auto &Report : Reports) { |
| 48 | if (!Report) |
| 49 | continue; |
| 50 | |
| 51 | auto ReportJson = Report->toJson(); |
| 52 | for (auto MemberName : ReportJson.getMemberNames()) |
| 53 | Root[MemberName] = ReportJson[MemberName]; |
| 54 | } |
| 55 | |
| 56 | Json::StreamWriterBuilder Writer; |
| 57 | std::ofstream Ofs(OutputFilePath); |
| 58 | Ofs << Json::writeString(Writer, Root); |
| 59 | Ofs.close(); |
| 60 | return true; |
| 61 | } |
| 62 | |
| 63 | std::vector<Unittest> UTAnalyzer::extractUnittests() const { |
| 64 | assert(Extractor && Loader && "Unexpected Program State"); |