12#include "llvm/Testing/Support/SupportHelpers.h"
13#include "gtest/gtest.h"
22 FS.Files[
testPath(
".clang-tidy")] = R
"yaml(
27 FS.Files[testPath("sub1/.clang-tidy")] = R
"yaml(
32 FS.Files[testPath("sub1/sub2/.clang-tidy")] = R
"yaml(
36 InheritParentConfig: true
42 ASSERT_TRUE(BaseOptions.Checks.has_value());
43 EXPECT_EQ(*BaseOptions.Checks,
"llvm-*");
44 EXPECT_EQ(BaseOptions.CheckOptions.lookup(
"TestKey").Value,
"1");
47 ASSERT_TRUE(Sub1Options.Checks.has_value());
48 EXPECT_EQ(*Sub1Options.Checks,
"misc-*");
49 EXPECT_EQ(Sub1Options.CheckOptions.lookup(
"TestKey").Value,
"2");
53 ASSERT_TRUE(Sub2Options.Checks.has_value());
54 EXPECT_EQ(*Sub2Options.Checks,
"misc-*,bugprone-*");
55 EXPECT_EQ(Sub2Options.CheckOptions.lookup(
"TestKey").Value,
"3");
59 EXPECT_THAT(
isFastTidyCheck(
"misc-const-correctness"), llvm::ValueIs(
false));
bool isRegisteredTidyCheck(llvm::StringRef Check)
Returns if Check is a registered clang-tidy check.
std::optional< bool > isFastTidyCheck(llvm::StringRef Check)
Returns if Check is known-fast, known-slow, or its speed is unknown.
std::string testPath(PathRef File, llvm::sys::path::Style Style)
TEST(BackgroundQueueTest, Priority)
TidyProvider provideClangTidyFiles(ThreadsafeFS &TFS)
Provider that searches for .clang-tidy configuration files in the directory tree.
tidy::ClangTidyOptions getTidyOptionsForFile(TidyProviderRef Provider, llvm::StringRef Filename)
llvm::unique_function< void(tidy::ClangTidyOptions &, llvm::StringRef) const > TidyProvider
A factory to modify a tidy::ClangTidyOptions.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//