Debian Codegraph @

clang-tools-extra/clangd/test/CMakeLists.txt

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