clang  13.0.0git
GtestMatchers.h
Go to the documentation of this file.
1 //===- GtestMatchers.h - AST Matchers for GTest -----------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements matchers specific to structures in the Googletest
10 // (gtest) framework.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_ASTMATCHERS_GTESTMATCHERS_H
15 #define LLVM_CLANG_ASTMATCHERS_GTESTMATCHERS_H
16 
17 #include "clang/AST/Stmt.h"
19 
20 namespace clang {
21 namespace ast_matchers {
22 
23 /// Gtest's comparison operations.
24 enum class GtestCmp {
25  Eq,
26  Ne,
27  Ge,
28  Gt,
29  Le,
30  Lt,
31 };
32 
33 /// Matcher for gtest's ASSERT_... macros.
34 internal::BindableMatcher<Stmt> gtestAssert(GtestCmp Cmp, StatementMatcher Left,
35  StatementMatcher Right);
36 
37 /// Matcher for gtest's EXPECT_... macros.
38 internal::BindableMatcher<Stmt> gtestExpect(GtestCmp Cmp, StatementMatcher Left,
39  StatementMatcher Right);
40 
41 } // namespace ast_matchers
42 } // namespace clang
43 
44 #endif // LLVM_CLANG_ASTMATCHERS_GTESTMATCHERS_H
45 
clang::ast_matchers::GtestCmp::Eq
@ Eq
clang::ast_matchers::StatementMatcher
internal::Matcher< Stmt > StatementMatcher
Definition: ASTMatchers.h:142
clang::ast_matchers::GtestCmp::Lt
@ Lt
clang::ast_matchers::GtestCmp
GtestCmp
Gtest's comparison operations.
Definition: GtestMatchers.h:24
ASTMatchers.h
clang::ast_matchers::gtestAssert
internal::BindableMatcher< Stmt > gtestAssert(GtestCmp Cmp, StatementMatcher Left, StatementMatcher Right)
Matcher for gtest's ASSERT_... macros.
Definition: GtestMatchers.cpp:89
clang::ast_matchers::GtestCmp::Le
@ Le
clang::ast_matchers::GtestCmp::Gt
@ Gt
clang::ast_matchers::GtestCmp::Ne
@ Ne
clang::ast_matchers::GtestCmp::Ge
@ Ge
clang
Definition: CalledOnceCheck.h:17
Stmt.h
clang::ast_matchers::gtestExpect
internal::BindableMatcher< Stmt > gtestExpect(GtestCmp Cmp, StatementMatcher Left, StatementMatcher Right)
Matcher for gtest's EXPECT_... macros.
Definition: GtestMatchers.cpp:96