| 1 |
set(CLANGD_TEST_DEPS |
| 2 |
clangd |
| 3 |
ClangdTests |
| 4 |
clangd-indexer |
| 5 |
split-file |
| 6 |
# No tests for it, but we should still make sure they build. |
| 7 |
dexp |
| 8 |
) |
| 9 |
|
| 10 |
if(CLANGD_BUILD_XPC) |
| 11 |
list(APPEND CLANGD_TEST_DEPS clangd-xpc-test-client) |
| 12 |
list(APPEND CLANGD_TEST_DEPS ClangdXpcUnitTests) |
| 13 |
endif() |
| 14 |
|
| 15 |
if(CLANGD_ENABLE_REMOTE) |
| 16 |
list(APPEND CLANGD_TEST_DEPS clangd-index-server clangd-index-server-monitor) |
| 17 |
endif() |
| 18 |
|
| 19 |
foreach(dep FileCheck count not llvm-config) |
| 20 |
if(TARGET ${dep}) |
| 21 |
list(APPEND CLANGD_TEST_DEPS ${dep}) |
| 22 |
endif() |
| 23 |
endforeach() |
| 24 |
|
| 25 |
configure_lit_site_cfg( |
| 26 |
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in |
| 27 |
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py |
| 28 |
MAIN_CONFIG |
| 29 |
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py |
| 30 |
) |
| 31 |
|
| 32 |
# Copy an empty compile_flags.txt to make sure tests don't pick up arbitrary |
| 33 |
# commands from parents. |
| 34 |
file( |
| 35 |
TOUCH |
| 36 |
${CMAKE_CURRENT_BINARY_DIR}/compile_flags.txt |
| 37 |
) |
| 38 |
|
| 39 |
add_lit_testsuite(check-clangd "Running the Clangd regression tests" |
| 40 |
# clangd doesn't put unittest configs in test/unit like every other project. |
| 41 |
# Because of that, this needs to pass two folders here, while every other |
| 42 |
# project only needs to pass CMAKE_CURRENT_BINARY_DIR. |
| 43 |
${CMAKE_CURRENT_BINARY_DIR}/../unittests;${CMAKE_CURRENT_BINARY_DIR} |
| 44 |
DEPENDS ${CLANGD_TEST_DEPS}) |