| 140 | } |
| 141 | |
| 142 | bool TATestHelper::analyze() { |
| 143 | if (!Compile) |
| 144 | return false; |
| 145 | |
| 146 | auto ExternalReportDir = getUniqueFilePath(getTmpDirPath(), "target", ""); |
| 147 | if (!fs::create_directories(ExternalReportDir)) |
| 148 | return false; |
| 149 | |
| 150 | for (auto &External : Externals) { |
| 151 | if (!External) |
| 152 | continue; |
| 153 | |
| 154 | auto ExternalReportPath = |
| 155 | getUniqueFilePath(ExternalReportDir, "external", "json"); |
| 156 | if (!External->dumpReport(ExternalReportPath)) |
| 157 | continue; |
| 158 | } |
| 159 | |
| 160 | Analyzer = std::make_unique<TargetLibAnalyzer>( |
| 161 | Compile, std::make_shared<APIManualLoader>(), ExternalReportDir); |
| 162 | if (!Analyzer) |
| 163 | return false; |
| 164 | |
| 165 | fs::remove_all(ExternalReportDir); |
| 166 | return Analyzer->analyze(); |
| 167 | } |
| 168 | |
| 169 | bool TATestHelper::dumpReport(std::string Path) { |
| 170 | if (!Analyzer) |
no test coverage detected