blob: 9782638fe09135a2a8652233a96c8013a009e597 [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
Chandler Carruthf71b73d2012-08-07 08:33:0410option(CLANG_TOOLS_TEST_USE_VG "Run Clang tools' tests under Valgrind" OFF)
11if(CLANG_TOOLS_TEST_USE_VG)
12 set(CLANG_TOOLS_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
13endif()
14
Edwin Vane08085af2013-02-19 19:08:1015add_subdirectory(cpp11-migrate)
16
17set(TEST_SOURCE_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
18set(TEST_EXEC_ROOT ${CMAKE_CURRENT_BINARY_DIR})
19set(TESTSUITE_NAME "Clang Tools")
20configure_lit_site_cfg(
21 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
22 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
23 )
24
Chandler Carruthf71b73d2012-08-07 08:33:0425set(CLANG_TOOLS_TEST_DEPS
26 # Base line deps.
27 clang clang-headers FileCheck count not
28
Edwin Vane08085af2013-02-19 19:08:1029 # cpp11-migrate auto-generated tests. See cpp11-migrate/CMakeLists.txt.
30 cpp11-migrate-autogen
31
Chandler Carruthf71b73d2012-08-07 08:33:0432 # Individual tools we test.
Alexander Kornienko574cf4b2013-01-14 13:57:0533 remove-cstr-calls cpp11-migrate clang-format
Chandler Carruth5f8cfa72012-08-07 07:09:1434 )
35
Chandler Carruthf71b73d2012-08-07 08:33:0436add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"
37 ${CMAKE_CURRENT_BINARY_DIR}
Edwin Vane08085af2013-02-19 19:08:1038 ${CMAKE_CURRENT_BINARY_DIR}/cpp11-migrate/autogen
Chandler Carruthf71b73d2012-08-07 08:33:0439 DEPENDS ${CLANG_TOOLS_TEST_DEPS}
40 ARGS ${CLANG_TOOLS_TEST_EXTRA_ARGS}
41 )
42set_target_properties(check-clang-tools PROPERTIES FOLDER "Clang extra tools' tests")