Debian Codegraph @

llvm-project/clang-tools-extra/clangd/unittests/CMakeLists.txt

raw
1 set(LLVM_LINK_COMPONENTS
2 support
3 AllTargetsInfos
4 FrontendOpenMP
5 )
6
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)
13 endif()
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
17 lib/Testing/Support)
18 endif()
19 endif()
20
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)
25 endif()
26
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)
29
30 add_custom_target(ClangdUnitTests)
31 add_unittest(ClangdUnitTests ClangdTests
32 Annotations.cpp
33 ASTTests.cpp
34 ASTSignalsTests.cpp
35 BackgroundIndexTests.cpp
36 CallHierarchyTests.cpp
37 CanonicalIncludesTests.cpp
38 ClangdTests.cpp
39 ClangdLSPServerTests.cpp
40 CodeCompleteTests.cpp
41 CodeCompletionStringsTests.cpp
42 CollectMacrosTests.cpp
43 CompileCommandsTests.cpp
44 CompilerTests.cpp
45 ConfigCompileTests.cpp
46 ConfigProviderTests.cpp
47 ConfigYAMLTests.cpp
48 DecisionForestTests.cpp
49 DexTests.cpp
50 DiagnosticsTests.cpp
51 DraftStoreTests.cpp
52 DumpASTTests.cpp
53 ExpectedTypeTest.cpp
54 FeatureModulesTests.cpp
55 FileDistanceTests.cpp
56 FileIndexTests.cpp
57 FindSymbolsTests.cpp
58 FindTargetTests.cpp
59 FormatTests.cpp
60 FSTests.cpp
61 FuzzyMatchTests.cpp
62 GlobalCompilationDatabaseTests.cpp
63 HeadersTests.cpp
64 HeaderSourceSwitchTests.cpp
65 HoverTests.cpp
66 IncludeCleanerTests.cpp
67 IndexActionTests.cpp
68 IndexTests.cpp
69 InlayHintTests.cpp
70 InsertionPointTests.cpp
71 JSONTransportTests.cpp
72 LoggerTests.cpp
73 LSPBinderTests.cpp
74 LSPClient.cpp
75 ModulesTests.cpp
76 ParsedASTTests.cpp
77 PathMappingTests.cpp
78 PreambleTests.cpp
79 PrintASTTests.cpp
80 ProjectAwareIndexTests.cpp
81 QualityTests.cpp
82 RenameTests.cpp
83 RIFFTests.cpp
84 SelectionTests.cpp
85 SemanticHighlightingTests.cpp
86 SemanticSelectionTests.cpp
87 SerializationTests.cpp
88 SourceCodeTests.cpp
89 StdLibTests.cpp
90 SymbolCollectorTests.cpp
91 SymbolInfoTests.cpp
92 SyncAPI.cpp
93 TUSchedulerTests.cpp
94 TestFS.cpp
95 TestIndex.cpp
96 TestTU.cpp
97 TestWorkspace.cpp
98 ThreadCrashReporterTests.cpp
99 TidyProviderTests.cpp
100 TypeHierarchyTests.cpp
101 URITests.cpp
102 XRefsTests.cpp
103 ${CMAKE_CURRENT_BINARY_DIR}/DecisionForestRuntimeTest.cpp
104
105 support/CancellationTests.cpp
106 support/ContextTests.cpp
107 support/FunctionTests.cpp
108 support/MarkupTests.cpp
109 support/MemoryTreeTests.cpp
110 support/PathTests.cpp
111 support/ThreadingTests.cpp
112 support/TestTracer.cpp
113 support/TraceTests.cpp
114
115 tweaks/AddUsingTests.cpp
116 tweaks/AnnotateHighlightingsTests.cpp
117 tweaks/DefineInlineTests.cpp
118 tweaks/DefineOutlineTests.cpp
119 tweaks/DumpASTTests.cpp
120 tweaks/DumpRecordLayoutTests.cpp
121 tweaks/DumpSymbolTests.cpp
122 tweaks/ExpandDeducedTypeTests.cpp
123 tweaks/ExpandMacroTests.cpp
124 tweaks/ExtractFunctionTests.cpp
125 tweaks/ExtractVariableTests.cpp
126 tweaks/MemberwiseConstructorTests.cpp
127 tweaks/ObjCLocalizeStringLiteralTests.cpp
128 tweaks/ObjCMemberwiseInitializerTests.cpp
129 tweaks/PopulateSwitchTests.cpp
130 tweaks/RawStringLiteralTests.cpp
131 tweaks/RemoveUsingNamespaceTests.cpp
132 tweaks/ShowSelectionTreeTests.cpp
133 tweaks/SwapIfBranchesTests.cpp
134 tweaks/TweakTesting.cpp
135 tweaks/TweakTests.cpp
136
137 ${REMOTE_TEST_SOURCES}
138
139 $<TARGET_OBJECTS:obj.clangDaemonTweaks>
140 )
141
142 # Include generated ComletionModel headers.
143 target_include_directories(ClangdTests PUBLIC
144 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
145 )
146
147 clang_target_link_libraries(ClangdTests
148 PRIVATE
149 clangAST
150 clangASTMatchers
151 clangBasic
152 clangFormat
153 clangFrontend
154 clangIndex
155 clangLex
156 clangSema
157 clangSerialization
158 clangTooling
159 clangToolingCore
160 clangToolingInclusions
161 clangToolingInclusionsStdlib
162 clangToolingRefactoring
163 clangToolingSyntax
164 )
165 target_link_libraries(ClangdTests
166 PRIVATE
167 LLVMTestingAnnotations
168 LLVMTestingSupport
169
170 clangDaemon
171 clangIncludeCleaner
172 clangTidy
173 clangdSupport
174 )
175
176 if (CLANGD_ENABLE_REMOTE)
177 target_link_libraries(ClangdTests
178 PRIVATE
179 clangdRemoteMarshalling
180 clangdRemoteIndexProto)
181 endif()
182
183 if (CLANGD_BUILD_XPC)
184 add_subdirectory(xpc)
185 endif ()
186
187 configure_lit_site_cfg(
188 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
189 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)