llvm/clang-tools-extra/include-cleaner/unittests/RecordTest.cpp

//===-- RecordTest.cpp ----------------------------------------------------===//
//
// 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 "clang-include-cleaner/Record.h"
#include "clang-include-cleaner/Types.h"
#include "clang/AST/Decl.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/FileEntry.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/FrontendOptions.h"
#include "clang/Serialization/PCHContainerOperations.h"
#include "clang/Testing/TestAST.h"
#include "clang/Tooling/Inclusions/StandardLibrary.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <cassert>
#include <memory>
#include <optional>
#include <utility>

namespace clang::include_cleaner {
namespace {
ElementsAreArray;
IsEmpty;

// Matches a Decl* if it is a NamedDecl with the given name.
MATCHER_P(named, N, "") {}

MATCHER_P(FileNamed, N, "") {}

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

// Top-level decl from the main file is a root, nested ones aren't.
TEST_F(RecordASTTest, Namespace) {}

// Decl in included file is not a root.
TEST_F(RecordASTTest, Inclusion) {}

// Decl from macro expanded into the main file is a root.
TEST_F(RecordASTTest, Macros) {}

// Decl from template instantiation is filtered out from roots.
TEST_F(RecordASTTest, ImplicitTemplates) {}

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

// Matches an Include with a particular spelling.
MATCHER_P(spelled, S, "") {}

TEST_F(RecordPPTest, CapturesIncludes) {}

TEST_F(RecordPPTest, CapturesMacroRefs) {}

TEST_F(RecordPPTest, CapturesConditionalMacroRefs) {}

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

TEST_F(PragmaIncludeTest, IWYUKeep) {}

TEST_F(PragmaIncludeTest, AssociatedHeader) {}

TEST_F(PragmaIncludeTest, IWYUPrivate) {}

TEST_F(PragmaIncludeTest, IWYUExport) {}

TEST_F(PragmaIncludeTest, IWYUExportForStandardHeaders) {}

TEST_F(PragmaIncludeTest, IWYUExportBlock) {}

TEST_F(PragmaIncludeTest, SelfContained) {}

TEST_F(PragmaIncludeTest, AlwaysKeep) {}

TEST_F(PragmaIncludeTest, ExportInUnnamedBuffer) {}

TEST_F(PragmaIncludeTest, OutlivesFMAndSM) {}

TEST_F(PragmaIncludeTest, CanRecordManyTimes) {}
} // namespace
} // namespace clang::include_cleaner