1 set(LLVM_LINK_COMPONENTS
7 if(CLANG_BUILT_STANDALONE)
8 # LLVMTestingSupport and LLVMTestingAnnotations are needed for clangd tests.
9 if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Annotations
10 AND NOT TARGET LLVMTestingAnnotations)
11 add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Annotations
12 lib/Testing/Annotations)
14 if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
15 AND NOT TARGET LLVMTestingSupport)
16 add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
21 if (CLANGD_ENABLE_REMOTE)
22 include_directories(${CMAKE_CURRENT_BINARY_DIR}/../index/remote)
23 add_definitions(-DGOOGLE_PROTOBUF_NO_RTTI=1)
24 set(REMOTE_TEST_SOURCES remote/MarshallingTests.cpp)
27 include(${CMAKE_CURRENT_SOURCE_DIR}/../quality/CompletionModel.cmake)
28 gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/decision_forest_model DecisionForestRuntimeTest ::ns1::ns2::test::Example)
30 add_custom_target(ClangdUnitTests)
31 add_unittest(ClangdUnitTests ClangdTests
35 BackgroundIndexTests.cpp
36 CallHierarchyTests.cpp
37 CanonicalIncludesTests.cpp
39 ClangdLSPServerTests.cpp
41 CodeCompletionStringsTests.cpp
42 CollectMacrosTests.cpp
43 CompileCommandsTests.cpp
45 ConfigCompileTests.cpp
46 ConfigProviderTests.cpp
48 DecisionForestTests.cpp
54 FeatureModulesTests.cpp
62 GlobalCompilationDatabaseTests.cpp
64 HeaderSourceSwitchTests.cpp
66 IncludeCleanerTests.cpp
70 InsertionPointTests.cpp
71 JSONTransportTests.cpp
80 ProjectAwareIndexTests.cpp
84 ReplayPeambleTests.cpp
86 SemanticHighlightingTests.cpp
87 SemanticSelectionTests.cpp
88 SerializationTests.cpp
91 SymbolCollectorTests.cpp
99 ThreadCrashReporterTests.cpp
100 TidyProviderTests.cpp
101 TypeHierarchyTests.cpp
104 ${CMAKE_CURRENT_BINARY_DIR}/DecisionForestRuntimeTest.cpp
106 support/CancellationTests.cpp
107 support/ContextTests.cpp
108 support/FileCacheTests.cpp
109 support/FunctionTests.cpp
110 support/MarkupTests.cpp
111 support/MemoryTreeTests.cpp
112 support/PathTests.cpp
113 support/TestTracer.cpp
114 support/ThreadingTests.cpp
115 support/TraceTests.cpp
117 tweaks/AddUsingTests.cpp
118 tweaks/AnnotateHighlightingsTests.cpp
119 tweaks/DefineInlineTests.cpp
120 tweaks/DefineOutlineTests.cpp
121 tweaks/DumpASTTests.cpp
122 tweaks/DumpRecordLayoutTests.cpp
123 tweaks/DumpSymbolTests.cpp
124 tweaks/ExpandDeducedTypeTests.cpp
125 tweaks/ExpandMacroTests.cpp
126 tweaks/ExtractFunctionTests.cpp
127 tweaks/ExtractVariableTests.cpp
128 tweaks/MemberwiseConstructorTests.cpp
129 tweaks/ObjCLocalizeStringLiteralTests.cpp
130 tweaks/ObjCMemberwiseInitializerTests.cpp
131 tweaks/PopulateSwitchTests.cpp
132 tweaks/RawStringLiteralTests.cpp
133 tweaks/RemoveUsingNamespaceTests.cpp
134 tweaks/ShowSelectionTreeTests.cpp
135 tweaks/SpecialMembersTests.cpp
136 tweaks/SwapIfBranchesTests.cpp
137 tweaks/TweakTesting.cpp
138 tweaks/TweakTests.cpp
140 ${REMOTE_TEST_SOURCES}
142 $<TARGET_OBJECTS:obj.clangDaemonTweaks>
145 # Include generated ComletionModel headers.
146 target_include_directories(ClangdTests PUBLIC
147 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
150 clang_target_link_libraries(ClangdTests
163 clangToolingInclusions
164 clangToolingInclusionsStdlib
165 clangToolingRefactoring
168 target_link_libraries(ClangdTests
170 LLVMTestingAnnotations
180 if (CLANGD_ENABLE_REMOTE)
181 target_link_libraries(ClangdTests
183 clangdRemoteMarshalling
184 clangdRemoteIndexProto)
187 if (CLANGD_BUILD_XPC)
188 add_subdirectory(xpc)
191 configure_lit_site_cfg(
192 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
193 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)