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
13 LLVM_INSTALL_TOOLCHAIN_ONLY
16 configure_lit_site_cfg(
17 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
18 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
20 ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
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
27 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
30 set(CLANG_TOOLS_TEST_DEPS
31 # For the clang-doc tests that emit bitcode files.
34 # Individual tools we test.
35 clang-apply-replacements
36 clang-change-namespace
49 # clang-tidy tests require it.
50 clang-resource-headers
55 # Add lit test dependencies.
59 foreach(dep ${LLVM_UTILS_DEPS})
61 list(APPEND CLANG_TOOLS_TEST_DEPS ${dep})
65 if (NOT WIN32 OR NOT LLVM_LINK_LLVM_DYLIB)
68 MODULE clang-tidy/CTTestTidyModule.cpp
69 PLUGIN_TOOL clang-tidy)
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
82 add_lit_testsuite(check-clang-extra "Running clang-tools-extra/test"
83 ${CMAKE_CURRENT_BINARY_DIR}
84 DEPENDS ${CLANG_TOOLS_TEST_DEPS}
87 add_lit_testsuites(CLANG-EXTRA ${CMAKE_CURRENT_SOURCE_DIR}
88 DEPENDS ${CLANG_TOOLS_TEST_DEPS}