Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang-tools-extra/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(CLANG_TOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")

llvm_canonicalize_cmake_booleans(
CLANG_TIDY_ENABLE_STATIC_ANALYZER
CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS
CLANG_PLUGIN_SUPPORT
LLVM_INSTALL_TOOLCHAIN_ONLY
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: custom-check
// RUN: %check_clang_tidy %s custom-* %t --config-file=%S/Inputs/incorrect-clang-tidy.yml

// CHECK-MESSAGES: warning: 1:1: Matcher not found: varDeclInvalid in 'test-let-bind-invalid-2' [clang-tidy-config]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: custom-check
// RUN: %check_clang_tidy %s custom-test-let-bind %t --config-file=%S/Inputs/clang-tidy.yml

extern long E;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: custom-check
// RUN: %check_clang_tidy %s custom-* %t --config-file=%S/Inputs/clang-tidy.yml

extern long E;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// REQUIRES: shell
// REQUIRES: custom-check

// RUN: sed -e "s:INPUT_DIR:%S/Inputs/custom-query-check:g" -e "s:OUT_DIR:%t:g" -e "s:MAIN_FILE:%s:g" %S/Inputs/custom-query-check/vfsoverlay.yaml > %t.yaml
// RUN: clang-tidy --experimental-custom-checks %t/main.cpp -checks='-*,custom-*' -vfsoverlay %t.yaml | FileCheck %s --check-prefix=CHECK-SAME-DIR
// RUN: clang-tidy --experimental-custom-checks %t/subdir/main.cpp -checks='-*,custom-*' -vfsoverlay %t.yaml | FileCheck %s --check-prefix=CHECK-SUB-DIR-BASE
Expand All @@ -6,7 +9,6 @@
// RUN: clang-tidy --experimental-custom-checks %t/subdir-append/main.cpp -checks='-*,custom-*' -vfsoverlay %t.yaml | FileCheck %s --check-prefix=CHECK-SUB-DIR-APPEND
// RUN: clang-tidy --experimental-custom-checks %t/subdir-append/main.cpp -checks='-*,custom-*' -vfsoverlay %t.yaml --list-checks | FileCheck %s --check-prefix=LIST-CHECK
// RUN: clang-tidy --experimental-custom-checks %t/subdir-append/main.cpp -checks='-*,custom-*' -vfsoverlay %t.yaml --dump-config | FileCheck %s --check-prefix=DUMP-CONFIG
// REQUIRES: shell


long V;
Expand Down
3 changes: 2 additions & 1 deletion clang-tools-extra/test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@

if config.clang_tidy_staticanalyzer:
config.available_features.add("static-analyzer")

if config.clang_tidy_custom_check:
config.available_features.add("custom-check")
python_exec = shlex.quote(config.python_executable)
check_clang_tidy = os.path.join(
config.test_source_root, "clang-tidy", "check_clang_tidy.py"
Expand Down
1 change: 1 addition & 0 deletions clang-tools-extra/test/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config.python_executable = "@Python3_EXECUTABLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.clang_tidy_staticanalyzer = @CLANG_TIDY_ENABLE_STATIC_ANALYZER@
config.clang_tidy_custom_check = @CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS@
config.has_plugins = @CLANG_PLUGIN_SUPPORT@
# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.
Expand Down
8 changes: 7 additions & 1 deletion clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ target_link_libraries(ClangTidyTests
PRIVATE
clangTidy
clangTidyAndroidModule
clangTidyCustomModule
clangTidyGoogleModule
clangTidyMiscModule
clangTidyLLVMModule
Expand All @@ -65,3 +64,10 @@ target_link_libraries(ClangTidyTests
LLVMTestingAnnotations
LLVMTestingSupport
)

if(CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS)
target_link_libraries(ClangTidyTests
PRIVATE
clangTidyCustomModule
)
endif()