| 25 | } |
| 26 | |
| 27 | const std::vector<Unittest> |
| 28 | BoostExtractor::getTestcasesFromASTUnit(const llvm::Module &M, |
| 29 | ASTUnit &U) const { |
| 30 | std::vector<Unittest> UTs; |
| 31 | for (const auto *TestRecord : getTestRecords(U.getASTContext())) { |
| 32 | assert(TestRecord && "Unexpected Program State"); |
| 33 | |
| 34 | const auto *TestBody = getTestBody(*TestRecord, U.getASTContext()); |
| 35 | assert(TestBody && "Unexpected Program State"); |
| 36 | |
| 37 | const auto *IR = util::getIRFunction(M, TestBody); |
| 38 | assert(IR && "Unexpected Program State"); |
| 39 | |
| 40 | std::vector<FunctionNode> Nodes; |
| 41 | if (TestBody->getName() == TestBodyName) |
| 42 | Nodes.emplace_back(*IR, true); |
| 43 | UTs.emplace_back(*TestRecord, "boost", Nodes); |
| 44 | } |
| 45 | |
| 46 | return UTs; |
| 47 | } |
| 48 | |
| 49 | const std::set<const CXXRecordDecl *> |
| 50 | BoostExtractor::getTestRecords(clang::ASTContext &Ctx) const { |
nothing calls this directly
no test coverage detected