[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang-tools-extra / clangd / unittests / CMakeLists.txt
blob692d7f8038d955858197471a4085317d2cca6b89
1 set(LLVM_LINK_COMPONENTS
2   support
3   AllTargetsInfos
4   FrontendOpenMP
5   )
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
12       lib/Testing/Support)
13   endif()
14 endif()
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)
20 endif()
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
27   Annotations.cpp
28   ASTTests.cpp
29   ASTSignalsTests.cpp
30   BackgroundIndexTests.cpp
31   CallHierarchyTests.cpp
32   CanonicalIncludesTests.cpp
33   ClangdTests.cpp
34   ClangdLSPServerTests.cpp
35   CodeCompleteTests.cpp
36   CodeCompletionStringsTests.cpp
37   CollectMacrosTests.cpp
38   CompileCommandsTests.cpp
39   CompilerTests.cpp
40   ConfigCompileTests.cpp
41   ConfigProviderTests.cpp
42   ConfigYAMLTests.cpp
43   DecisionForestTests.cpp
44   DexTests.cpp
45   DiagnosticsTests.cpp
46   DraftStoreTests.cpp
47   DumpASTTests.cpp
48   ExpectedTypeTest.cpp
49   FeatureModulesTests.cpp
50   FileDistanceTests.cpp
51   FileIndexTests.cpp
52   FindSymbolsTests.cpp
53   FindTargetTests.cpp
54   FormatTests.cpp
55   FSTests.cpp
56   FuzzyMatchTests.cpp
57   GlobalCompilationDatabaseTests.cpp
58   HeadersTests.cpp
59   HeaderSourceSwitchTests.cpp
60   HoverTests.cpp
61   IncludeCleanerTests.cpp
62   IndexActionTests.cpp
63   IndexTests.cpp
64   InlayHintTests.cpp
65   InsertionPointTests.cpp
66   JSONTransportTests.cpp
67   LoggerTests.cpp
68   LSPBinderTests.cpp
69   LSPClient.cpp
70   ModulesTests.cpp
71   ParsedASTTests.cpp
72   PathMappingTests.cpp
73   PreambleTests.cpp
74   PrintASTTests.cpp
75   ProjectAwareIndexTests.cpp
76   QualityTests.cpp
77   RenameTests.cpp
78   RIFFTests.cpp
79   SelectionTests.cpp
80   SemanticHighlightingTests.cpp
81   SemanticSelectionTests.cpp
82   SerializationTests.cpp
83   SourceCodeTests.cpp
84   StdLibTests.cpp
85   SymbolCollectorTests.cpp
86   SymbolInfoTests.cpp
87   SyncAPI.cpp
88   TUSchedulerTests.cpp
89   TestFS.cpp
90   TestIndex.cpp
91   TestTU.cpp
92   TestWorkspace.cpp
93   ThreadCrashReporterTests.cpp
94   TidyProviderTests.cpp
95   TypeHierarchyTests.cpp
96   URITests.cpp
97   XRefsTests.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>
135   )
137 # Include generated ComletionModel headers.
138 target_include_directories(ClangdTests PUBLIC
139   $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
142 clang_target_link_libraries(ClangdTests
143   PRIVATE
144   clangAST
145   clangASTMatchers
146   clangBasic
147   clangFormat
148   clangFrontend
149   clangIndex
150   clangLex
151   clangSema
152   clangSerialization
153   clangTooling
154   clangToolingCore
155   clangToolingInclusions
156   clangToolingRefactoring
157   clangToolingSyntax
158   )
159 target_link_libraries(ClangdTests
160   PRIVATE
161   clangDaemon
162   clangdSupport
163   clangTidy
164   LLVMTestingSupport
165   )
167 if (CLANGD_ENABLE_REMOTE)
168   target_link_libraries(ClangdTests
169     PRIVATE
170     clangdRemoteMarshalling
171     clangdRemoteIndexProto)
172 endif()
174 if (CLANGD_BUILD_XPC)
175   add_subdirectory(xpc)
176 endif ()
178 configure_lit_site_cfg(
179   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
180   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)