| 63 | } |
| 64 | |
| 65 | const 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 | |
| 94 | const std::vector<const NamedDecl *> |
| 95 | GoogleTestExtractor::getTestSequence(const clang::NamedDecl *Test) { |