llvm/clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp

//===-- TypeHierarchyTests.cpp  ---------------------------*- C++ -*-------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "AST.h"
#include "Annotations.h"
#include "Matchers.h"
#include "ParsedAST.h"
#include "TestFS.h"
#include "TestTU.h"
#include "XRefs.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include "llvm/Support/Path.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <vector>

namespace clang {
namespace clangd {
namespace {

AllOf;
ElementsAre;
Field;
IsEmpty;
Matcher;
SizeIs;
UnorderedElementsAre;

// GMock helpers for matching TypeHierarchyItem.
MATCHER_P(withName, N, "") {}
MATCHER_P(withKind, Kind, "") {}
MATCHER_P(selectionRangeIs, R, "") {}
template <class... ParentMatchers>
::testing::Matcher<TypeHierarchyItem> parents(ParentMatchers... ParentsM) {}
template <class... ChildMatchers>
::testing::Matcher<TypeHierarchyItem> children(ChildMatchers... ChildrenM) {}
// Note: "not resolved" is different from "resolved but empty"!
MATCHER(parentsNotResolved, "") {}
MATCHER(childrenNotResolved, "") {}
MATCHER_P(withResolveID, SID, "") {}
MATCHER_P(withResolveParents, M, "") {}

TEST(FindRecordTypeAt, TypeOrVariable) {}

TEST(FindRecordTypeAt, Nonexistent) {}

TEST(FindRecordTypeAt, Method) {}

TEST(FindRecordTypeAt, Field) {}

TEST(TypeParents, SimpleInheritance) {}

TEST(TypeParents, MultipleInheritance) {}

TEST(TypeParents, ClassTemplate) {}

MATCHER_P(implicitSpecOf, ClassTemplate, "") {}

// This is similar to findDecl(AST, QName), but supports using
// a template-id as a query.
const NamedDecl &findDeclWithTemplateArgs(ParsedAST &AST,
                                          llvm::StringRef Query) {}

TEST(TypeParents, TemplateSpec1) {}

TEST(TypeParents, TemplateSpec2) {}

TEST(TypeParents, DependentBase) {}

TEST(TypeParents, IncompleteClass) {}

// Parts of getTypeHierarchy() are tested in more detail by the
// FindRecordTypeAt.* and TypeParents.* tests above. This test exercises the
// entire operation.
TEST(TypeHierarchy, Parents) {}

TEST(TypeHierarchy, RecursiveHierarchyUnbounded) {}

TEST(TypeHierarchy, RecursiveHierarchyBounded) {}

TEST(TypeHierarchy, DeriveFromImplicitSpec) {}

TEST(TypeHierarchy, DeriveFromPartialSpec) {}

TEST(TypeHierarchy, DeriveFromTemplate) {}

TEST(TypeHierarchy, Preamble) {}

SymbolID findSymbolIDByName(SymbolIndex *Index, llvm::StringRef Name,
                            llvm::StringRef TemplateArgs = "") {}

std::vector<SymbolID> collectSubtypes(SymbolID Subject, SymbolIndex *Index) {}

TEST(Subtypes, SimpleInheritance) {}

TEST(Subtypes, MultipleInheritance) {}

TEST(Subtypes, ClassTemplate) {}

TEST(Subtypes, TemplateSpec1) {}

TEST(Subtypes, TemplateSpec2) {}

TEST(Subtypes, DependentBase) {}

TEST(Subtypes, LazyResolution) {}

TEST(Standard, SubTypes) {}

TEST(Standard, SuperTypes) {}
} // namespace
} // namespace clangd
} // namespace clang