23#include "llvm/ADT/DenseMap.h"
24#include "llvm/ADT/StringRef.h"
27namespace ast_matchers {
43 hasName(
"::testing::internal::EqHelper")))));
55 llvm_unreachable(
"Unhandled GtestCmp enum");
60 case MacroType::Expect:
62 case MacroType::Assert:
67 llvm_unreachable(
"Unhandled MacroType enum");
85 llvm_unreachable(
"Unhandled GtestCmp enum");
92static std::string
getMacroName(MacroType Macro, llvm::StringRef Operation) {
103 return "InternalDefaultActionSetAt";
104 case MacroType::Expect:
105 return "InternalExpectedAt";
107 llvm_unreachable(
"Unhandled MacroType enum");
109 llvm_unreachable(
"Unhandled MacroType enum");
121static internal::BindableMatcher<Stmt>
126 hasArgument(3, Right));
129static internal::BindableMatcher<Stmt>
137 "::testing::internal::PredicateFormatterFromMatcher"))),
140 "::testing::internal::"
141 "MakePredicateFormatterFromMatcher"))),
142 hasArgument(0, ignoringImplicit(Matcher)))))));
145static internal::BindableMatcher<Stmt>
161 onImplicitObjectArgument(ignoringImplicit(MockCall)));
174 hasArgument(0, ignoringImplicit(MockCall))))));
176 llvm_unreachable(
"Unhandled MockArgs enum");
179static internal::BindableMatcher<Stmt>
181 llvm::StringRef MockMethodName,
MockArgs Args) {
185 onImplicitObjectArgument(MockObject),
211 llvm::StringRef MockMethodName,
222 llvm::StringRef MockMethodName,
Defines the clang::ASTContext interface.
internal::BindableMatcher< Stmt > gtestAssert(GtestCmp Cmp, StatementMatcher Left, StatementMatcher Right)
Matcher for gtest's ASSERT comparison macros including ASSERT_EQ, ASSERT_NE, ASSERT_GE,...
static internal::BindableMatcher< Stmt > gtestComparisonInternal(MacroType Macro, GtestCmp Cmp, StatementMatcher Left, StatementMatcher Right)
MockArgs
This enum indicates whether the mock method in the matched ON_CALL or EXPECT_CALL macro has arguments...
static llvm::StringRef getComparisonTypeName(GtestCmp Cmp)
GtestCmp
Gtest's comparison operations.
internal::Matcher< Decl > DeclarationMatcher
Types of matchers for the top-level classes in the AST class hierarchy.
static DeclarationMatcher getComparisonDecl(GtestCmp Cmp)
internal::BindableMatcher< Stmt > gtestExpect(GtestCmp Cmp, StatementMatcher Left, StatementMatcher Right)
Matcher for gtest's EXPECT comparison macros including EXPECT_EQ, EXPECT_NE, EXPECT_GE,...
internal::Matcher< NamedDecl > hasName(StringRef Name)
Matches NamedDecl nodes that have the specified name.
const internal::VariadicDynCastAllOfMatcher< Stmt, CallExpr > callExpr
Matches call expressions.
static llvm::StringRef getMacroTypeName(MacroType Macro)
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXMemberCallExpr > cxxMemberCallExpr
Matches member call expressions.
internal::BindableMatcher< Stmt > gtestExpectThat(StatementMatcher Actual, StatementMatcher Matcher)
Matcher for gtest's EXPECT_THAT macro.
static internal::BindableMatcher< Stmt > gtestThatInternal(MacroType Macro, StatementMatcher Actual, StatementMatcher Matcher)
internal::Matcher< Stmt > StatementMatcher
internal::BindableMatcher< Stmt > gtestAssertThat(StatementMatcher Actual, StatementMatcher Matcher)
Matcher for gtest's ASSERT_THAT macro.
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXOperatorCallExpr > cxxOperatorCallExpr
Matches overloaded operator calls.
internal::PolymorphicMatcher< internal::HasOverloadedOperatorNameMatcher, AST_POLYMORPHIC_SUPPORTED_TYPES(CXXOperatorCallExpr, FunctionDecl), std::vector< std::string > > hasOverloadedOperatorName(StringRef Name)
Matches overloaded operator names.
const internal::VariadicDynCastAllOfMatcher< Decl, ClassTemplateSpecializationDecl > classTemplateSpecializationDecl
Matches C++ class template specializations.
const internal::VariadicDynCastAllOfMatcher< Decl, FunctionDecl > functionDecl
Matches function declarations.
const internal::VariadicDynCastAllOfMatcher< Decl, CXXRecordDecl > cxxRecordDecl
Matches C++ class declarations.
internal::BindableMatcher< Stmt > gtestOnCall(StatementMatcher MockObject, llvm::StringRef MockMethodName, MockArgs Args)
Like the first gtestExpectCall overload but for ON_CALL.
static std::string getMacroName(MacroType Macro, GtestCmp Cmp)
internal::BindableMatcher< Stmt > gtestExpectCall(StatementMatcher MockObject, llvm::StringRef MockMethodName, MockArgs Args)
Matcher for gtest's EXPECT_CALL macro.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
static llvm::StringRef getSpecSetterName(MacroType Macro)
const internal::VariadicDynCastAllOfMatcher< Decl, CXXMethodDecl > cxxMethodDecl
Matches method declarations.
static internal::BindableMatcher< Stmt > gtestCallInternal(MacroType Macro, StatementMatcher MockCall, MockArgs Args)
The JSON file list parser is used to communicate input to InstallAPI.