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" 18 #include "clang/ASTMatchers/ASTMatchers.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 46