| 264 | } |
| 265 | |
| 266 | bool GenTestHelper::generate(std::string BaseDir, std::string OutputDir, |
| 267 | std::vector<std::string> APINames) { |
| 268 | |
| 269 | if (!UA) |
| 270 | return false; |
| 271 | |
| 272 | TargetDirPath = getUniqueFilePath(getTmpDirPath(), "target", ""); |
| 273 | if (!storeTargetAnalysisReport(TargetDirPath)) |
| 274 | return false; |
| 275 | |
| 276 | UTReportPath = getUniqueFilePath(getTmpDirPath(), "ut", "json"); |
| 277 | if (!UA->dumpReport(UTReportPath)) |
| 278 | return false; |
| 279 | |
| 280 | std::set<std::string> APINameSet(APINames.begin(), APINames.end()); |
| 281 | |
| 282 | if (fs::exists(OutputDir)) { |
| 283 | if (!fs::remove_all(OutputDir)) |
| 284 | return false; |
| 285 | } |
| 286 | if (!fs::create_directories(OutputDir)) |
| 287 | return false; |
| 288 | |
| 289 | FuzzGenerator.generate(BaseDir, APINameSet, TargetDirPath, UTReportPath, |
| 290 | OutputDir); |
| 291 | |
| 292 | return true; |
| 293 | } |
| 294 | |
| 295 | const Generator &GenTestHelper::getGenerator() const { return FuzzGenerator; } |
| 296 |
no test coverage detected