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

Method findTestMethodRecursively

lib/tcanalysis/GoogleTestExtractor.cpp:65–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65const CXXMethodDecl *GoogleTestExtractor::findTestMethodRecursively(
66 const CXXRecordDecl *ClassCXXRecordDecl, std::string TargetMethodName) {
67 if (!ClassCXXRecordDecl)
68 return nullptr;
69
70 const CXXMethodDecl *TestMethod =
71 findTestMethod(ClassCXXRecordDecl, TargetMethodName);
72 if (TestMethod)
73 return TestMethod;
74
75 for (auto SuperClassBaseSpecifier : ClassCXXRecordDecl->bases()) {
76 auto *T = SuperClassBaseSpecifier.getType()->getAs<RecordType>();
77 if (!T)
78 continue;
79
80 auto *SuperClassCXXRecordDecl =
81 dyn_cast_or_null<CXXRecordDecl>(T->getDecl());
82 if (!SuperClassCXXRecordDecl)
83 continue;
84
85 TestMethod =
86 findTestMethodRecursively(SuperClassCXXRecordDecl, TargetMethodName);
87 if (TestMethod)
88 return TestMethod;
89 }
90
91 return nullptr;
92}
93
94const std::vector<const NamedDecl *>
95GoogleTestExtractor::getTestSequence(const clang::NamedDecl *Test) {

Callers

nothing calls this directly

Calls 1

getTypeMethod · 0.45

Tested by

no test coverage detected