1 set(LLVM_LINK_COMPONENTS
7 if(CLANG_BUILT_STANDALONE)
8 # LLVMTestingSupport library is needed for clangd tests.
9 if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
10 AND NOT TARGET LLVMTestingSupport)
11 add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
16 if (CLANGD_ENABLE_REMOTE)
17 include_directories(${CMAKE_CURRENT_BINARY_DIR}/../index/remote)
18 add_definitions(-DGOOGLE_PROTOBUF_NO_RTTI=1)
19 set(REMOTE_TEST_SOURCES remote/MarshallingTests.cpp)
22 include(${CMAKE_CURRENT_SOURCE_DIR}/../quality/CompletionModel.cmake)
23 gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/decision_forest_model DecisionForestRuntimeTest ::ns1::ns2::test::Example)
25 add_custom_target(ClangdUnitTests)
26 add_unittest(ClangdUnitTests ClangdTests
30 BackgroundIndexTests.cpp
31 CallHierarchyTests.cpp
32 CanonicalIncludesTests.cpp
34 ClangdLSPServerTests.cpp
36 CodeCompletionStringsTests.cpp
37 CollectMacrosTests.cpp
38 CompileCommandsTests.cpp
40 ConfigCompileTests.cpp
41 ConfigProviderTests.cpp
43 DecisionForestTests.cpp
49 FeatureModulesTests.cpp
57 GlobalCompilationDatabaseTests.cpp
59 HeaderSourceSwitchTests.cpp
61 IncludeCleanerTests.cpp
65 InsertionPointTests.cpp
66 JSONTransportTests.cpp
75 ProjectAwareIndexTests.cpp
80 SemanticHighlightingTests.cpp
81 SemanticSelectionTests.cpp
82 SerializationTests.cpp
85 SymbolCollectorTests.cpp
93 ThreadCrashReporterTests.cpp
95 TypeHierarchyTests.cpp
98 ${CMAKE_CURRENT_BINARY_DIR}/DecisionForestRuntimeTest.cpp
100 support/CancellationTests.cpp
101 support/ContextTests.cpp
102 support/FunctionTests.cpp
103 support/MarkupTests.cpp
104 support/MemoryTreeTests.cpp
105 support/PathTests.cpp
106 support/ThreadingTests.cpp
107 support/TestTracer.cpp
108 support/TraceTests.cpp
110 tweaks/AddUsingTests.cpp
111 tweaks/AnnotateHighlightingsTests.cpp
112 tweaks/DefineInlineTests.cpp
113 tweaks/DefineOutlineTests.cpp
114 tweaks/DumpASTTests.cpp
115 tweaks/DumpRecordLayoutTests.cpp
116 tweaks/DumpSymbolTests.cpp
117 tweaks/ExpandAutoTypeTests.cpp
118 tweaks/ExpandMacroTests.cpp
119 tweaks/ExtractFunctionTests.cpp
120 tweaks/ExtractVariableTests.cpp
121 tweaks/MemberwiseConstructorTests.cpp
122 tweaks/ObjCLocalizeStringLiteralTests.cpp
123 tweaks/ObjCMemberwiseInitializerTests.cpp
124 tweaks/PopulateSwitchTests.cpp
125 tweaks/RawStringLiteralTests.cpp
126 tweaks/RemoveUsingNamespaceTests.cpp
127 tweaks/ShowSelectionTreeTests.cpp
128 tweaks/SwapIfBranchesTests.cpp
129 tweaks/TweakTesting.cpp
130 tweaks/TweakTests.cpp
132 ${REMOTE_TEST_SOURCES}
134 $<TARGET_OBJECTS:obj.clangDaemonTweaks>
137 # Include generated ComletionModel headers.
138 target_include_directories(ClangdTests PUBLIC
139 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
142 clang_target_link_libraries(ClangdTests
155 clangToolingInclusions
156 clangToolingRefactoring
159 target_link_libraries(ClangdTests
167 if (CLANGD_ENABLE_REMOTE)
168 target_link_libraries(ClangdTests
170 clangdRemoteMarshalling
171 clangdRemoteIndexProto)
174 if (CLANGD_BUILD_XPC)
175 add_subdirectory(xpc)
178 configure_lit_site_cfg(
179 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
180 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)