Chandler Carruth | 118232f | 2012-08-07 08:33:04 | [diff] [blame] | 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. |
Chandler Carruth | c5062dc | 2012-08-07 07:09:14 | [diff] [blame] | 3 | # |
Chandler Carruth | 118232f | 2012-08-07 08:33:04 | [diff] [blame] | 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.. |
Chandler Carruth | c5062dc | 2012-08-07 07:09:14 | [diff] [blame] | 6 | |
Chandler Carruth | 118232f | 2012-08-07 08:33:04 | [diff] [blame] | 7 | set(CLANG_TOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") |
| 8 | set(CLANG_TOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..") |
Chandler Carruth | c5062dc | 2012-08-07 07:09:14 | [diff] [blame] | 9 | |
NAKAMURA Takumi | 5d942f2 | 2014-01-19 11:19:07 | [diff] [blame] | 10 | if (CMAKE_CFG_INTDIR STREQUAL ".") |
| 11 | set(LLVM_BUILD_MODE ".") |
| 12 | else () |
| 13 | set(LLVM_BUILD_MODE "%(build_mode)s") |
| 14 | endif () |
| 15 | |
NAKAMURA Takumi | c28a9a2 | 2014-01-19 13:00:01 | [diff] [blame] | 16 | string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) |
NAKAMURA Takumi | 5d942f2 | 2014-01-19 11:19:07 | [diff] [blame] | 17 | |
Edwin Vane | 8b526f2 | 2013-02-19 19:08:10 | [diff] [blame] | 18 | configure_lit_site_cfg( |
| 19 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in |
| 20 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
| 21 | ) |
| 22 | |
Edwin Vane | c0b7be6 | 2013-04-03 15:11:08 | [diff] [blame] | 23 | configure_lit_site_cfg( |
| 24 | ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in |
| 25 | ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg |
| 26 | ) |
| 27 | |
Chandler Carruth | 074a356 | 2013-03-07 10:09:47 | [diff] [blame] | 28 | option(CLANG_TOOLS_TEST_USE_VG "Run Clang tools' tests under Valgrind" OFF) |
| 29 | if(CLANG_TOOLS_TEST_USE_VG) |
| 30 | set(CLANG_TOOLS_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg") |
| 31 | endif() |
| 32 | |
Chandler Carruth | 118232f | 2012-08-07 08:33:04 | [diff] [blame] | 33 | set(CLANG_TOOLS_TEST_DEPS |
| 34 | # Base line deps. |
NAKAMURA Takumi | 21bf7a1 | 2013-12-09 19:27:46 | [diff] [blame] | 35 | FileCheck count not |
Chandler Carruth | 118232f | 2012-08-07 08:33:04 | [diff] [blame] | 36 | |
NAKAMURA Takumi | ecba4c3 | 2015-12-21 01:35:28 | [diff] [blame] | 37 | # clang-tidy tests require it. |
| 38 | clang-headers |
| 39 | |
Benjamin Kramer | 8f5eb56 | 2016-03-03 08:58:12 | [diff] [blame] | 40 | # For the clang-tidy libclang integration test. |
| 41 | c-index-test |
| 42 | |
Chandler Carruth | 074a356 | 2013-03-07 10:09:47 | [diff] [blame] | 43 | # Individual tools we test. |
NAKAMURA Takumi | a256eb4 | 2013-10-31 12:46:10 | [diff] [blame] | 44 | clang-apply-replacements |
Benjamin Kramer | cf4c6d8 | 2016-04-27 14:32:36 | [diff] [blame] | 45 | clang-include-fixer |
Peter Collingbourne | b549019 | 2014-02-18 19:46:01 | [diff] [blame] | 46 | clang-query |
Benjamin Kramer | cf4c6d8 | 2016-04-27 14:32:36 | [diff] [blame] | 47 | clang-rename |
NAKAMURA Takumi | a256eb4 | 2013-10-31 12:46:10 | [diff] [blame] | 48 | clang-tidy |
| 49 | modularize |
NAKAMURA Takumi | 125a417 | 2013-10-31 12:46:16 | [diff] [blame] | 50 | pp-trace |
Edwin Vane | c0b7be6 | 2013-04-03 15:11:08 | [diff] [blame] | 51 | |
| 52 | # Unit tests |
| 53 | ExtraToolsUnitTests |
Chandler Carruth | c5062dc | 2012-08-07 07:09:14 | [diff] [blame] | 54 | ) |
| 55 | |
Chandler Carruth | 074a356 | 2013-03-07 10:09:47 | [diff] [blame] | 56 | add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests" |
Chandler Carruth | 118232f | 2012-08-07 08:33:04 | [diff] [blame] | 57 | ${CMAKE_CURRENT_BINARY_DIR} |
| 58 | DEPENDS ${CLANG_TOOLS_TEST_DEPS} |
| 59 | ARGS ${CLANG_TOOLS_TEST_EXTRA_ARGS} |
| 60 | ) |
Chandler Carruth | 074a356 | 2013-03-07 10:09:47 | [diff] [blame] | 61 | set_target_properties(check-clang-tools PROPERTIES FOLDER "Clang extra tools' tests") |
| 62 | |