1 set(LLVM_LINK_COMPONENTS
8 if(CLANG_BUILT_STANDALONE)
9 # LLVMTestingSupport and LLVMTestingAnnotations are needed for clangd tests.
10 if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Annotations
11 AND NOT TARGET LLVMTestingAnnotations)
12 add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Annotations
13 lib/Testing/Annotations)
15 if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
16 AND NOT TARGET LLVMTestingSupport)
17 add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
22 if (CLANGD_ENABLE_REMOTE)
23 include_directories(${CMAKE_CURRENT_BINARY_DIR}/../index/remote)
24 add_definitions(-DGOOGLE_PROTOBUF_NO_RTTI=1)
25 set(REMOTE_TEST_SOURCES remote/MarshallingTests.cpp)
28 include(${CMAKE_CURRENT_SOURCE_DIR}/../quality/CompletionModel.cmake)
29 gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/decision_forest_model DecisionForestRuntimeTest ::ns1::ns2::test::Example)
31 add_custom_target(ClangdUnitTests)
32 set_target_properties(ClangdUnitTests PROPERTIES FOLDER "Clang Tools Extra/Tests")
33 add_unittest(ClangdUnitTests ClangdTests
37 BackgroundIndexTests.cpp
38 CallHierarchyTests.cpp
39 CanonicalIncludesTests.cpp
41 ClangdLSPServerTests.cpp
43 CodeCompletionStringsTests.cpp
44 CollectMacrosTests.cpp
45 CompileCommandsTests.cpp
47 ConfigCompileTests.cpp
48 ConfigProviderTests.cpp
50 DecisionForestTests.cpp
56 FeatureModulesTests.cpp
64 GlobalCompilationDatabaseTests.cpp
66 HeaderSourceSwitchTests.cpp
68 IncludeCleanerTests.cpp
72 InsertionPointTests.cpp
73 JSONTransportTests.cpp
77 PrerequisiteModulesTest.cpp
83 ProjectAwareIndexTests.cpp
87 ReplayPeambleTests.cpp
89 SemanticHighlightingTests.cpp
90 SemanticSelectionTests.cpp
91 SerializationTests.cpp
94 SymbolCollectorTests.cpp
102 ThreadCrashReporterTests.cpp
103 TidyProviderTests.cpp
104 TypeHierarchyTests.cpp
107 ${CMAKE_CURRENT_BINARY_DIR}/DecisionForestRuntimeTest.cpp
109 support/CancellationTests.cpp
110 support/ContextTests.cpp
111 support/FileCacheTests.cpp
112 support/FunctionTests.cpp
113 support/MarkupTests.cpp
114 support/MemoryTreeTests.cpp
115 support/PathTests.cpp
116 support/TestTracer.cpp
117 support/ThreadingTests.cpp
118 support/TraceTests.cpp
120 tweaks/AddUsingTests.cpp
121 tweaks/AnnotateHighlightingsTests.cpp
122 tweaks/DefineInlineTests.cpp
123 tweaks/DefineOutlineTests.cpp
124 tweaks/DumpASTTests.cpp
125 tweaks/DumpRecordLayoutTests.cpp
126 tweaks/DumpSymbolTests.cpp
127 tweaks/ExpandDeducedTypeTests.cpp
128 tweaks/ExpandMacroTests.cpp
129 tweaks/ExtractFunctionTests.cpp
130 tweaks/ExtractVariableTests.cpp
131 tweaks/MemberwiseConstructorTests.cpp
132 tweaks/ObjCLocalizeStringLiteralTests.cpp
133 tweaks/ObjCMemberwiseInitializerTests.cpp
134 tweaks/PopulateSwitchTests.cpp
135 tweaks/RawStringLiteralTests.cpp
136 tweaks/RemoveUsingNamespaceTests.cpp
137 tweaks/ScopifyEnumTests.cpp
138 tweaks/ShowSelectionTreeTests.cpp
139 tweaks/SpecialMembersTests.cpp
140 tweaks/SwapIfBranchesTests.cpp
141 tweaks/TweakTesting.cpp
142 tweaks/TweakTests.cpp
144 ${REMOTE_TEST_SOURCES}
146 $<TARGET_OBJECTS:obj.clangDaemonTweaks>
149 # Include generated ComletionModel headers.
150 target_include_directories(ClangdTests PUBLIC
151 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
154 clang_target_link_libraries(ClangdTests
167 clangToolingInclusions
168 clangToolingInclusionsStdlib
169 clangToolingRefactoring
172 target_link_libraries(ClangdTests
174 LLVMTestingAnnotations
185 if (CLANGD_ENABLE_REMOTE)
186 target_link_libraries(ClangdTests
188 clangdRemoteMarshalling
189 clangdRemoteIndexProto)
192 if (CLANGD_BUILD_XPC)
193 add_subdirectory(xpc)
196 configure_lit_site_cfg(
197 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
198 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)