#include "../clang-tidy/ClangTidyOptions.h"
#include "Annotations.h"
#include "Config.h"
#include "Diagnostics.h"
#include "Feature.h"
#include "FeatureModule.h"
#include "ParsedAST.h"
#include "Protocol.h"
#include "TestFS.h"
#include "TestIndex.h"
#include "TestTU.h"
#include "TidyProvider.h"
#include "index/MemIndex.h"
#include "index/Ref.h"
#include "index/Relation.h"
#include "index/Symbol.h"
#include "support/Context.h"
#include "support/Path.h"
#include "clang/AST/Decl.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticSema.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/Specifiers.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <cstddef>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
namespace clang {
namespace clangd {
namespace {
_;
AllOf;
Contains;
Each;
ElementsAre;
Field;
IsEmpty;
Not;
Pair;
SizeIs;
UnorderedElementsAre;
::testing::Matcher<const Diag &> withFix(::testing::Matcher<Fix> FixMatcher) { … }
::testing::Matcher<const Diag &> withFix(::testing::Matcher<Fix> FixMatcher1,
::testing::Matcher<Fix> FixMatcher2) { … }
::testing::Matcher<const Diag &> withID(unsigned ID) { … }
::testing::Matcher<const Diag &>
withNote(::testing::Matcher<Note> NoteMatcher) { … }
::testing::Matcher<const Diag &>
withNote(::testing::Matcher<Note> NoteMatcher1,
::testing::Matcher<Note> NoteMatcher2) { … }
::testing::Matcher<const Diag &>
withTag(::testing::Matcher<DiagnosticTag> TagMatcher) { … }
MATCHER_P(hasRange, Range, "") { … }
MATCHER_P2(Diag, Range, Message,
"Diag at " + llvm::to_string(Range) + " = [" + Message + "]") { … }
MATCHER_P3(Fix, Range, Replacement, Message,
"Fix " + llvm::to_string(Range) + " => " +
::testing::PrintToString(Replacement) + " = [" + Message + "]") { … }
MATCHER_P(fixMessage, Message, "") { … }
MATCHER_P(equalToLSPDiag, LSPDiag,
"LSP diagnostic " + llvm::to_string(LSPDiag)) { … }
MATCHER_P(diagSource, S, "") { … }
MATCHER_P(diagName, N, "") { … }
MATCHER_P(diagSeverity, S, "") { … }
MATCHER_P(equalToFix, Fix, "LSP fix " + llvm::to_string(Fix)) { … }
Position pos(int Line, int Character) { … }
::testing::Matcher<std::vector<clangd::Diag>>
ifTidyChecks(::testing::Matcher<std::vector<clangd::Diag>> M) { … }
TEST(DiagnosticsTest, DiagnosticRanges) { … }
TEST(DiagnosticsTest, WSwitch) { … }
TEST(DiagnosticsTest, FlagsMatter) { … }
TEST(DiagnosticsTest, DiagnosticPreamble) { … }
TEST(DiagnosticsTest, DeduplicatedClangTidyDiagnostics) { … }
TEST(DiagnosticsTest, ClangTidy) { … }
TEST(DiagnosticsTest, ClangTidyEOF) { … }
TEST(DiagnosticTest, TemplatesInHeaders) { … }
TEST(DiagnosticTest, MakeUnique) { … }
TEST(DiagnosticTest, CoroutineInHeader) { … }
TEST(DiagnosticTest, MakeShared) { … }
TEST(DiagnosticTest, NoMultipleDiagnosticInFlight) { … }
TEST(DiagnosticTest, RespectsDiagnosticConfig) { … }
TEST(DiagnosticTest, RespectsDiagnosticConfigInHeader) { … }
TEST(DiagnosticTest, ClangTidySuppressionComment) { … }
TEST(DiagnosticTest, ClangTidySystemMacro) { … }
TEST(DiagnosticTest, ClangTidyWarningAsError) { … }
TidyProvider addClangArgs(std::vector<llvm::StringRef> ExtraArgs,
llvm::StringRef Checks) { … }
TEST(DiagnosticTest, ClangTidyEnablesClangWarning) { … }
TEST(DiagnosticTest, LongFixMessages) { … }
TEST(DiagnosticTest, NewLineFixMessage) { … }
TEST(DiagnosticTest, ClangTidySuppressionCommentTrumpsWarningAsError) { … }
TEST(DiagnosticTest, ClangTidyNoLiteralDataInMacroToken) { … }
TEST(DiagnosticTest, ElseAfterReturnRange) { … }
TEST(DiagnosticTest, ClangTidySelfContainedDiags) { … }
TEST(DiagnosticTest, ClangTidySelfContainedDiagsFormatting) { … }
TEST(DiagnosticsTest, ClangTidyCallingIntoPreprocessor) { … }
TEST(DiagnosticsTest, Preprocessor) { … }
TEST(DiagnosticsTest, IgnoreVerify) { … }
TEST(DiagnosticTest, IgnoreBEFilelistOptions) { … }
TEST(DiagnosticsTest, RecursivePreamble) { … }
TEST(DiagnosticsTest, RecursivePreamblePragmaOnce) { … }
TEST(DiagnosticsTest, RecursivePreambleIfndefGuard) { … }
TEST(DiagnosticsTest, PreambleWithPragmaAssumeNonnull) { … }
TEST(DiagnosticsTest, PreambleHeaderWithBadPragmaAssumeNonnull) { … }
TEST(DiagnosticsTest, InsideMacros) { … }
TEST(DiagnosticsTest, NoFixItInMacro) { … }
TEST(DiagnosticsTest, PragmaSystemHeader) { … }
TEST(ClangdTest, MSAsm) { … }
TEST(DiagnosticsTest, ToLSP) { … }
struct SymbolWithHeader { … };
std::unique_ptr<SymbolIndex>
buildIndexWithSymbol(llvm::ArrayRef<SymbolWithHeader> Syms) { … }
TEST(IncludeFixerTest, IncompleteType) { … }
TEST(IncludeFixerTest, IncompleteEnum) { … }
TEST(IncludeFixerTest, NoSuggestIncludeWhenNoDefinitionInHeader) { … }
TEST(IncludeFixerTest, Typo) { … }
TEST(IncludeFixerTest, TypoInMacro) { … }
TEST(IncludeFixerTest, MultipleMatchedSymbols) { … }
TEST(IncludeFixerTest, NoCrashMemberAccess) { … }
TEST(IncludeFixerTest, UseCachedIndexResults) { … }
TEST(IncludeFixerTest, UnresolvedNameAsSpecifier) { … }
TEST(IncludeFixerTest, UnresolvedSpecifierWithSemaCorrection) { … }
TEST(IncludeFixerTest, SpecifiedScopeIsNamespaceAlias) { … }
TEST(IncludeFixerTest, NoCrashOnTemplateInstantiations) { … }
TEST(IncludeFixerTest, HeaderNamedInDiag) { … }
TEST(IncludeFixerTest, CImplicitFunctionDecl) { … }
TEST(DiagsInHeaders, DiagInsideHeader) { … }
TEST(DiagsInHeaders, DiagInTransitiveInclude) { … }
TEST(DiagsInHeaders, DiagInMultipleHeaders) { … }
TEST(DiagsInHeaders, PreferExpansionLocation) { … }
TEST(DiagsInHeaders, PreferExpansionLocationMacros) { … }
TEST(DiagsInHeaders, LimitDiagsOutsideMainFile) { … }
TEST(DiagsInHeaders, OnlyErrorOrFatal) { … }
TEST(DiagsInHeaders, OnlyDefaultErrorOrFatal) { … }
TEST(DiagsInHeaders, FromNonWrittenSources) { … }
TEST(DiagsInHeaders, ErrorFromMacroExpansion) { … }
TEST(DiagsInHeaders, ErrorFromMacroArgument) { … }
TEST(IgnoreDiags, FromNonWrittenInclude) { … }
TEST(ToLSPDiag, RangeIsInMain) { … }
TEST(ParsedASTTest, ModuleSawDiag) { … }
TEST(Preamble, EndsOnNonEmptyLine) { … }
TEST(Diagnostics, Tags) { … }
TEST(Diagnostics, TidyDiagsArentAffectedFromWerror) { … }
TEST(Diagnostics, DeprecatedDiagsAreHints) { … }
TEST(DiagnosticsTest, IncludeCleaner) { … }
TEST(DiagnosticsTest, FixItFromHeader) { … }
TEST(DiagnosticsTest, UnusedInHeader) { … }
}
}
}