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

Method getTestcasesFromASTUnit

lib/tcanalysis/BoostExtractor.cpp:27–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27const std::vector<Unittest>
28BoostExtractor::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
49const std::set<const CXXRecordDecl *>
50BoostExtractor::getTestRecords(clang::ASTContext &Ctx) const {

Callers

nothing calls this directly

Calls 2

getIRFunctionFunction · 0.85
getNameMethod · 0.45

Tested by

no test coverage detected