AMDGPU: Remove FeatureCvtFP8VOP1Bug from gfx950 (#117827)
[llvm-project.git] / clang-tools-extra / test / CMakeLists.txt
blob7e4d99d8cfc1d3951d3bcba23bd34f17b1d223d5
1 # Test runner infrastructure for Clang-based tools. This configures the Clang
2 # test trees for use by Lit, and delegates to LLVM's lit test handlers.
4 # Note that currently we don't support stand-alone builds of Clang, you must
5 # be building Clang from within a combined LLVM+Clang checkout..
7 set(CLANG_TOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
8 set(CLANG_TOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
10 llvm_canonicalize_cmake_booleans(
11   CLANG_TIDY_ENABLE_STATIC_ANALYZER
12   CLANG_PLUGIN_SUPPORT
13   LLVM_INSTALL_TOOLCHAIN_ONLY
14   )
16 configure_lit_site_cfg(
17   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
18   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
19   MAIN_CONFIG
20   ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
21   )
23 configure_lit_site_cfg(
24   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
25   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
26   MAIN_CONFIG
27   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
28   )
30 set(CLANG_TOOLS_TEST_DEPS
31   # For the clang-doc tests that emit bitcode files.
32   llvm-bcanalyzer
34   # Individual tools we test.
35   clang-apply-replacements
36   clang-change-namespace
37   clang-doc
38   clang-include-fixer
39   clang-move
40   clang-query
41   clang-reorder-fields
42   find-all-symbols
43   modularize
44   pp-trace
46   # Unit tests
47   ExtraToolsUnitTests
49   # clang-tidy tests require it.
50   clang-resource-headers
52   clang-tidy
55 # Add lit test dependencies.
56 set(LLVM_UTILS_DEPS
57   FileCheck count not
59 foreach(dep ${LLVM_UTILS_DEPS})
60   if(TARGET ${dep})
61     list(APPEND CLANG_TOOLS_TEST_DEPS ${dep})
62   endif()
63 endforeach()
65 if (NOT WIN32 OR NOT LLVM_LINK_LLVM_DYLIB)
66   llvm_add_library(
67       CTTestTidyModule
68       MODULE clang-tidy/CTTestTidyModule.cpp
69       PLUGIN_TOOL clang-tidy)
70 endif()
72 if(TARGET CTTestTidyModule)
73     list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule)
74     target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}")
75     if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN))
76       set(LLVM_LINK_COMPONENTS
77         Support
78       )
79     endif()
80 endif()
82 add_lit_testsuite(check-clang-extra "Running clang-tools-extra/test"
83    ${CMAKE_CURRENT_BINARY_DIR}
84    DEPENDS ${CLANG_TOOLS_TEST_DEPS}
85    )
87 add_lit_testsuites(CLANG-EXTRA ${CMAKE_CURRENT_SOURCE_DIR}
88   DEPENDS ${CLANG_TOOLS_TEST_DEPS}
89   )