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

source code of clang-tools-extra/unittests/clang-doc/ClangDocTest.h