File tree Expand file tree Collapse file tree 8 files changed +17
-3
lines changed Expand file tree Collapse file tree 8 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ set(CLANG_TOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
99
1010llvm_canonicalize_cmake_booleans(
1111 CLANG_TIDY_ENABLE_STATIC_ANALYZER
12+ CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS
1213 CLANG_PLUGIN_SUPPORT
1314 LLVM_INSTALL_TOOLCHAIN_ONLY
1415 )
Original file line number Diff line number Diff line change 1+ // REQUIRES: custom-check
12// RUN: %check_clang_tidy %s custom-* %t --config-file=%S/Inputs/incorrect-clang-tidy.yml
23
34// CHECK-MESSAGES: warning: 1:1: Matcher not found: varDeclInvalid in 'test-let-bind-invalid-2' [clang-tidy-config]
Original file line number Diff line number Diff line change 1+ // REQUIRES: custom-check
12// RUN: %check_clang_tidy %s custom-test-let-bind %t --config-file=%S/Inputs/clang-tidy.yml
23
34extern long E;
Original file line number Diff line number Diff line change 1+ // REQUIRES: custom-check
12// RUN: %check_clang_tidy %s custom-* %t --config-file=%S/Inputs/clang-tidy.yml
23
34extern long E;
Original file line number Diff line number Diff line change 1+ // REQUIRES: shell
2+ // REQUIRES: custom-check
3+
14// 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
25// RUN: clang-tidy --experimental-custom-checks %t/main.cpp -checks='-*,custom-*' -vfsoverlay %t.yaml | FileCheck %s --check-prefix=CHECK-SAME-DIR
36// RUN: clang-tidy --experimental-custom-checks %t/subdir/main.cpp -checks='-*,custom-*' -vfsoverlay %t.yaml | FileCheck %s --check-prefix=CHECK-SUB-DIR-BASE
69// RUN: clang-tidy --experimental-custom-checks %t/subdir-append/main.cpp -checks='-*,custom-*' -vfsoverlay %t.yaml | FileCheck %s --check-prefix=CHECK-SUB-DIR-APPEND
710// RUN: clang-tidy --experimental-custom-checks %t/subdir-append/main.cpp -checks='-*,custom-*' -vfsoverlay %t.yaml --list-checks | FileCheck %s --check-prefix=LIST-CHECK
811// RUN: clang-tidy --experimental-custom-checks %t/subdir-append/main.cpp -checks='-*,custom-*' -vfsoverlay %t.yaml --dump-config | FileCheck %s --check-prefix=DUMP-CONFIG
9- // REQUIRES: shell
1012
1113
1214long V;
Original file line number Diff line number Diff line change 5454
5555if config .clang_tidy_staticanalyzer :
5656 config .available_features .add ("static-analyzer" )
57-
57+ if config .clang_tidy_custom_check :
58+ config .available_features .add ("custom-check" )
5859python_exec = shlex .quote (config .python_executable )
5960check_clang_tidy = os .path .join (
6061 config .test_source_root , "clang-tidy" , "check_clang_tidy.py"
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ config.python_executable = "@Python3_EXECUTABLE@"
1010config.target_triple = "@LLVM_TARGET_TRIPLE@"
1111config.host_triple = "@LLVM_HOST_TRIPLE@"
1212config.clang_tidy_staticanalyzer = @CLANG_TIDY_ENABLE_STATIC_ANALYZER@
13+ config.clang_tidy_custom_check = @CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS@
1314config.has_plugins = @CLANG_PLUGIN_SUPPORT@
1415# Support substitution of the tools and libs dirs with user parameters. This is
1516# used when we can't determine the tool dir at configuration time.
Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ target_link_libraries(ClangTidyTests
5454 PRIVATE
5555 clangTidy
5656 clangTidyAndroidModule
57- clangTidyCustomModule
5857 clangTidyGoogleModule
5958 clangTidyMiscModule
6059 clangTidyLLVMModule
@@ -65,3 +64,10 @@ target_link_libraries(ClangTidyTests
6564 LLVMTestingAnnotations
6665 LLVMTestingSupport
6766 )
67+
68+ if (CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS)
69+ target_link_libraries (ClangTidyTests
70+ PRIVATE
71+ clangTidyCustomModule
72+ )
73+ endif ()
You can’t perform that action at this time.
0 commit comments