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

//===-- GlobalCompilationDatabaseTests.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 "GlobalCompilationDatabase.h"

#include "CompileCommands.h"
#include "Config.h"
#include "TestFS.h"
#include "support/Path.h"
#include "support/ThreadsafeFS.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Path.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <chrono>
#include <fstream>
#include <optional>
#include <string>

namespace clang {
namespace clangd {
namespace {
AllOf;
Contains;
ElementsAre;
EndsWith;
HasSubstr;
IsEmpty;
Not;
UnorderedElementsAre;

TEST(GlobalCompilationDatabaseTest, FallbackCommand) {}

static tooling::CompileCommand cmd(llvm::StringRef File, llvm::StringRef Arg) {}

class OverlayCDBTest : public ::testing::Test {};

TEST_F(OverlayCDBTest, GetCompileCommand) {}

TEST_F(OverlayCDBTest, GetFallbackCommand) {}

TEST_F(OverlayCDBTest, NoBase) {}

TEST_F(OverlayCDBTest, Watch) {}

TEST_F(OverlayCDBTest, Adjustments) {}

TEST_F(OverlayCDBTest, ExpandedResponseFiles) {}

TEST(GlobalCompilationDatabaseTest, DiscoveryWithNestedCDBs) {}

TEST(GlobalCompilationDatabaseTest, BuildDir) {}

TEST(GlobalCompilationDatabaseTest, CompileFlagsDirectory) {}

MATCHER_P(hasArg, Flag, "") {}

TEST(GlobalCompilationDatabaseTest, Config) {}

TEST(GlobalCompilationDatabaseTest, NonCanonicalFilenames) {}

TEST_F(OverlayCDBTest, GetProjectInfo) {}

TEST(GlobalCompilationDatabaseTest, InferenceWithResponseFile) {}
} // namespace

// Friend test has access to internals.
class DirectoryBasedGlobalCompilationDatabaseCacheTest
    : public ::testing::Test {};

// Matches non-null CDBs which include the specified flag.
MATCHER_P2(hasFlag, Flag, Path, "") {}

auto hasFlag(llvm::StringRef Flag) {}

TEST_F(DirectoryBasedGlobalCompilationDatabaseCacheTest, Cacheable) {}

} // namespace clangd
} // namespace clang