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

//===-- FileIndexTests.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 "Annotations.h"
#include "Compiler.h"
#include "Headers.h"
#include "ParsedAST.h"
#include "SyncAPI.h"
#include "TestFS.h"
#include "TestTU.h"
#include "TestWorkspace.h"
#include "URI.h"
#include "clang-include-cleaner/Record.h"
#include "index/FileIndex.h"
#include "index/Index.h"
#include "index/Ref.h"
#include "index/Relation.h"
#include "index/Serialization.h"
#include "index/Symbol.h"
#include "index/SymbolID.h"
#include "support/Threading.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/Allocator.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <memory>
#include <utility>
#include <vector>

_;
AllOf;
Contains;
ElementsAre;
Gt;
IsEmpty;
Pair;
UnorderedElementsAre;

MATCHER_P(refRange, Range, "") {}
MATCHER_P(fileURI, F, "") {}
MATCHER_P(declURI, U, "") {}
MATCHER_P(defURI, U, "") {}
MATCHER_P(qName, N, "") {}
MATCHER_P(numReferences, N, "") {}
MATCHER_P(hasOrign, O, "") {}

MATCHER_P(includeHeader, P, "") {}

namespace clang {
namespace clangd {
namespace {
::testing::Matcher<const RefSlab &>
refsAre(std::vector<::testing::Matcher<Ref>> Matchers) {}

Symbol symbol(llvm::StringRef ID) {}

std::unique_ptr<SymbolSlab> numSlab(int Begin, int End) {}

std::unique_ptr<RefSlab> refSlab(const SymbolID &ID, const char *Path) {}

std::unique_ptr<RelationSlab> relSlab(llvm::ArrayRef<const Relation> Rels) {}

TEST(FileSymbolsTest, UpdateAndGet) {}

TEST(FileSymbolsTest, Overlap) {}

TEST(FileSymbolsTest, MergeOverlap) {}

TEST(FileSymbolsTest, SnapshotAliveAfterRemove) {}

// Adds Basename.cpp, which includes Basename.h, which contains Code.
void update(FileIndex &M, llvm::StringRef Basename, llvm::StringRef Code) {}

TEST(FileIndexTest, CustomizedURIScheme) {}

TEST(FileIndexTest, IndexAST) {}

TEST(FileIndexTest, NoLocal) {}

TEST(FileIndexTest, IndexMultiASTAndDeduplicate) {}

TEST(FileIndexTest, ClassMembers) {}

TEST(FileIndexTest, IncludeCollected) {}

TEST(FileIndexTest, IWYUPragmaExport) {}

TEST(FileIndexTest, HasSystemHeaderMappingsInPreamble) {}

TEST(FileIndexTest, TemplateParamsInLabel) {}

TEST(FileIndexTest, RebuildWithPreamble) {}

TEST(FileIndexTest, Refs) {}

TEST(FileIndexTest, MacroRefs) {}

TEST(FileIndexTest, CollectMacros) {}

TEST(FileIndexTest, Relations) {}

TEST(FileIndexTest, RelationsMultiFile) {}

TEST(FileIndexTest, ReferencesInMainFileWithPreamble) {}

TEST(FileIndexTest, MergeMainFileSymbols) {}

TEST(FileSymbolsTest, CountReferencesNoRefSlabs) {}

TEST(FileSymbolsTest, CountReferencesWithRefSlabs) {}

TEST(FileIndexTest, StalePreambleSymbolsDeleted) {}

// Verifies that concurrent calls to updateMain don't "lose" any updates.
TEST(FileIndexTest, Threadsafety) {}

TEST(FileShardedIndexTest, Sharding) {}

TEST(FileIndexTest, Profile) {}

TEST(FileSymbolsTest, Profile) {}

TEST(FileIndexTest, MacrosFromMainFile) {}

} // namespace
} // namespace clangd
} // namespace clang