Commit Graph

13 Commits

Author SHA1 Message Date
Richard 89a1d03e2b [clang-tidy] Organize test files into subdirectories by module (NFC)
Eliminate clutter by reorganizing the Lit test files for clang-tidy:
- Move checkers/<module>-* to checkers/<module>/*.
- Move module specific inputs from Inputs to <module>/Inputs.  Remove
  any module prefix from the file or subdirectory name as they are no
  longer needed.
- Introduce a Lit substitution %clang_tidy_headers for the system
  headers in checkers/Inputs/Headers and use this throughout.  This
  avoids referencing system headers through a relative path to the
  parent directory and makes it clear that these fake system headers are
  shared among all modules.
- Update add_new_check.py to follow the above conventions when creating
  the boiler plate test files for a new check.
- Update Contributing.rst to describe per-module Inputs directory and
  fix link to test source code.

Differential Revision: https://reviews.llvm.org/D128072
2022-06-22 12:13:34 -06:00
Sam McCall 2b69eb4a7d [clang-tools-extra] Reuse llvm_config.use_clang() to set up test environment
This replaces a bunch of duplicate logic to set up environment variables
and a few substitutions.

It does a little more than we were doing previously:
 - searching for clang and setting up substitutions for it
 - setting up some substitutions for target triples, which are
   potentially useful but not actually used

clangd has been happily using this for its tests for a while.

Differential Revision: https://reviews.llvm.org/D121422
2022-03-15 22:14:24 +01:00
Sam McCall 7f0df31ee3 [clang-tools-extra] Don't consider python below LLVM_MINIMUM_PYTHON_VERSION. NFC 2022-03-10 23:57:27 +01:00
Sam McCall 2d58ba200a [clang-tools-extra] Remove unused lit features/substitutions. NFCI 2022-03-10 23:28:43 +01:00
Sam McCall 6ed2f8902b Fix reference to execute_external leftover in 69924ccf7a 2022-03-10 23:20:03 +01:00
Sam McCall 69924ccf7a Remove redundant lit config already handled in llvm_config. NFCI
This logic duplicates lit.llvm.initialize, which we're already calling
(in lit.site.cfg.py.in).
The equivalent logic was removed from clang in d4401d354a but
never cleaned up here.
2022-03-10 23:11:01 +01:00
Jameson Nash 84f137a590 Reland "enable plugins for clang-tidy"
This reverts commit ab3b89855c but
disables the new test if the user has disabled support for building it.
2022-02-01 17:37:24 -05:00
Petr Hosek ab3b89855c Revert "enable plugins for clang-tidy"
This reverts commit 36892727e4 which
breaks the build when LLVM_INSTALL_TOOLCHAIN_ONLY is enabled with:

  CMake Error at cmake/modules/AddLLVM.cmake:683 (add_dependencies):
  The dependency target "clang-tidy-headers" of target "CTTestTidyModule"
  does not exist.
2022-01-31 00:55:43 -08:00
Jameson Nash 36892727e4 enable plugins for clang-tidy
Fixes #32739

Differential Revision: https://reviews.llvm.org/D111100
2022-01-29 14:21:19 -05:00
Nico Weber 33c9dbbd38 Add an explicit toggle for the static analyzer in clang-tidy
Instead of using CLANG_ENABLE_STATIC_ANALYZER for use of the
static analyzer in both clang and clang-tidy, add a second
toggle CLANG_TIDY_ENABLE_STATIC_ANALYZER.

This allows enabling the static analyzer in clang-tidy while
disabling it in clang.

Differential Revison: https://reviews.llvm.org/D87118
2020-09-10 10:48:17 -04:00
Reid Kleckner b250a62a51 Quote path to Python executable in case it has spaces
These days Python 3 is typically installed into C:/Program Files, so
cope with that.

Similar to r364077 in compiler-rt.

llvm-svn: 364087
2019-06-21 18:17:04 +00:00
Fangrui Song 16a2131c62 [clangd] Delete config.clangd_xpc_support from test/ to unbreak check-llvm-tools
D61187 didn't delete config.clangd_xpc_support from test/
CLANGD_BUILD_XPC is defined in clangd/CMakeLists.txt and not available in test/lit.site.cfg.py.in

llvm-svn: 359428
2019-04-29 09:36:54 +00:00
Nico Weber ef7b84231e Add .py extension to clang-tools-extra lit cfg files
Follow-up to r313892, which did this for clang and llvm.

Differential Revision: https://reviews.llvm.org/D59953

llvm-svn: 357231
2019-03-29 02:46:31 +00:00