blob: a2cedeaaa53a34d6584ae96295438de2e272ea8a [file] [log] [blame]
Chandler Carruthf71b73d2012-08-07 08:33:041# 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.
Chandler Carruth5f8cfa72012-08-07 07:09:143#
Chandler Carruthf71b73d2012-08-07 08:33:044# 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..
Chandler Carruth5f8cfa72012-08-07 07:09:146
Chandler Carruthf71b73d2012-08-07 08:33:047set(CLANG_TOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
8set(CLANG_TOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
Chandler Carruth5f8cfa72012-08-07 07:09:149
NAKAMURA Takumic3b3e5e2014-01-19 11:19:0710if (CMAKE_CFG_INTDIR STREQUAL ".")
11 set(LLVM_BUILD_MODE ".")
12else ()
13 set(LLVM_BUILD_MODE "%(build_mode)s")
14endif ()
15
NAKAMURA Takumi49007da2014-01-19 13:00:0116string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
NAKAMURA Takumic3b3e5e2014-01-19 11:19:0717
Sam McCall79cdb5c2019-04-29 08:44:0118llvm_canonicalize_cmake_booleans(CLANG_ENABLE_STATIC_ANALYZER)
Michal Gorny24952e52017-08-29 05:58:0819
Edwin Vane08085af2013-02-19 19:08:1020configure_lit_site_cfg(
Nico Weber75e7ff32019-03-29 02:46:3121 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
22 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
23 MAIN_CONFIG
24 ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
Edwin Vane08085af2013-02-19 19:08:1025 )
26
Edwin Vaned22180f2013-04-03 15:11:0827configure_lit_site_cfg(
Nico Weber75e7ff32019-03-29 02:46:3128 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
29 ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
30 MAIN_CONFIG
31 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
Edwin Vaned22180f2013-04-03 15:11:0832 )
33
Chandler Carruthe79882e2013-03-07 10:09:4734option(CLANG_TOOLS_TEST_USE_VG "Run Clang tools' tests under Valgrind" OFF)
35if(CLANG_TOOLS_TEST_USE_VG)
36 set(CLANG_TOOLS_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
37endif()
38
Chandler Carruthf71b73d2012-08-07 08:33:0439set(CLANG_TOOLS_TEST_DEPS
Alex Lorenz8401b952017-06-30 16:58:3640 # For the clang-apply-replacements test that uses clang-rename.
41 clang-rename
Benjamin Kramerd99fffa2016-03-03 08:58:1242
Julie Hockett395afb12018-03-22 23:34:4643 # For the clang-doc tests that emit bitcode files.
44 llvm-bcanalyzer
45
Chandler Carruthe79882e2013-03-07 10:09:4746 # Individual tools we test.
NAKAMURA Takumi50fcf152013-10-31 12:46:1047 clang-apply-replacements
Eric Liuf68f0cd2016-09-19 17:40:3248 clang-change-namespace
Julie Hockett395afb12018-03-22 23:34:4649 clang-doc
Benjamin Kramer7e310d12016-04-27 14:32:3650 clang-include-fixer
Haojian Wu53bdceb2016-10-04 09:05:3151 clang-move
Peter Collingbourneda776c02014-02-18 19:46:0152 clang-query
Alexander Shaposhnikov3951c8f2016-09-02 02:56:0753 clang-reorder-fields
Benjamin Kramerfa0a0e82016-05-31 12:12:1954 find-all-symbols
NAKAMURA Takumi50fcf152013-10-31 12:46:1055 modularize
NAKAMURA Takumi2ab631e2013-10-31 12:46:1656 pp-trace
Edwin Vaned22180f2013-04-03 15:11:0857
58 # Unit tests
59 ExtraToolsUnitTests
Stephen Kelly5351cf62018-10-01 20:24:2260
61 # For the clang-tidy libclang integration test.
62 c-index-test
63 # clang-tidy tests require it.
Shoaib Meenaib8e003b2019-03-04 21:19:5364 clang-resource-headers
Stephen Kelly5351cf62018-10-01 20:24:2265
66 clang-tidy
Alexander Kornienkoce94c062019-03-22 13:42:4867 # Clang-tidy tests need clang for building modules.
68 clang
Jan Korousd05fd412019-01-16 00:24:2269)
70
Haojian Wu88085502018-11-22 10:14:5571# Add lit test dependencies.
72set(LLVM_UTILS_DEPS
73 FileCheck count not
74)
75foreach(dep ${LLVM_UTILS_DEPS})
76 if(TARGET ${dep})
Sam McCall591c6b52019-04-26 09:20:3677 list(APPEND CLANG_TOOLS_TEST_DEPS ${dep})
Haojian Wu88085502018-11-22 10:14:5578 endif()
79endforeach()
80
Chandler Carruthe79882e2013-03-07 10:09:4781add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"
Chandler Carruthf71b73d2012-08-07 08:33:0482 ${CMAKE_CURRENT_BINARY_DIR}
83 DEPENDS ${CLANG_TOOLS_TEST_DEPS}
84 ARGS ${CLANG_TOOLS_TEST_EXTRA_ARGS}
85 )
Chandler Carruthe79882e2013-03-07 10:09:4786
Kirill Bobyrevcb0c6c52017-06-28 20:57:2887set_target_properties(check-clang-tools PROPERTIES FOLDER "Clang extra tools' tests")