• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- clang-doc/ClangDocTest.h ------------------------------------------===//
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 #ifndef LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANG_DOC_CLANGDOCTEST_H
10 #define LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANG_DOC_CLANGDOCTEST_H
11 
12 #include "ClangDocTest.h"
13 #include "Representation.h"
14 #include "clang/AST/RecursiveASTVisitor.h"
15 #include "gtest/gtest.h"
16 
17 namespace clang {
18 namespace doc {
19 
20 using EmittedInfoList = std::vector<std::unique_ptr<Info>>;
21 
22 static const SymbolID EmptySID = SymbolID();
23 static const SymbolID NonEmptySID =
24     SymbolID{{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}};
25 
26 NamespaceInfo *InfoAsNamespace(Info *I);
27 RecordInfo *InfoAsRecord(Info *I);
28 FunctionInfo *InfoAsFunction(Info *I);
29 EnumInfo *InfoAsEnum(Info *I);
30 
31 // Unlike the operator==, these functions explicitly does not check USRs, as
32 // that may change and it would be better to not rely on its implementation.
33 void CheckReference(Reference &Expected, Reference &Actual);
34 void CheckTypeInfo(TypeInfo *Expected, TypeInfo *Actual);
35 void CheckFieldTypeInfo(FieldTypeInfo *Expected, FieldTypeInfo *Actual);
36 void CheckMemberTypeInfo(MemberTypeInfo *Expected, MemberTypeInfo *Actual);
37 
38 // This function explicitly does not check USRs, as that may change and it would
39 // be better to not rely on its implementation.
40 void CheckBaseInfo(Info *Expected, Info *Actual);
41 void CheckSymbolInfo(SymbolInfo *Expected, SymbolInfo *Actual);
42 void CheckFunctionInfo(FunctionInfo *Expected, FunctionInfo *Actual);
43 void CheckEnumInfo(EnumInfo *Expected, EnumInfo *Actual);
44 void CheckNamespaceInfo(NamespaceInfo *Expected, NamespaceInfo *Actual);
45 void CheckRecordInfo(RecordInfo *Expected, RecordInfo *Actual);
46 void CheckBaseRecordInfo(BaseRecordInfo *Expected, BaseRecordInfo *Actual);
47 
48 void CheckIndex(Index &Expected, Index &Actual);
49 
50 } // namespace doc
51 } // namespace clang
52 
53 #endif // LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANG_DOC_CLANGDOCTEST_H
54