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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

117 lines
2.4 KiB
CMake
Raw Normal View History

set(LLVM_LINK_COMPONENTS
support
AllTargetsInfos
)
get_filename_component(CLANGD_SOURCE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/../../clangd REALPATH)
get_filename_component(CLANGD_BINARY_DIR
${CMAKE_CURRENT_BINARY_DIR}/../../clangd REALPATH)
include_directories(
${CLANGD_SOURCE_DIR}
${CLANGD_BINARY_DIR}
)
if(CLANG_BUILT_STANDALONE)
# LLVMTestingSupport library is needed for clangd tests.
if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
AND NOT TARGET LLVMTestingSupport)
add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
lib/Testing/Support)
endif()
endif()
add_custom_target(ClangdUnitTests)
add_unittest(ClangdUnitTests ClangdTests
Annotations.cpp
ASTTests.cpp
BackgroundIndexTests.cpp
CancellationTests.cpp
CanonicalIncludesTests.cpp
ClangdTests.cpp
CodeCompleteTests.cpp
CodeCompletionStringsTests.cpp
CollectMacrosTests.cpp
CompileCommandsTests.cpp
ContextTests.cpp
DexTests.cpp
DiagnosticsTests.cpp
DraftStoreTests.cpp
ExpectedTypeTest.cpp
FileDistanceTests.cpp
2018-07-25 18:34:57 +08:00
FileIndexTests.cpp
FindSymbolsTests.cpp
FindTargetTests.cpp
FormattedStringTests.cpp
FormatTests.cpp
FSTests.cpp
FunctionTests.cpp
FuzzyMatchTests.cpp
GlobalCompilationDatabaseTests.cpp
HeadersTests.cpp
HeaderSourceSwitchTests.cpp
HoverTests.cpp
IndexActionTests.cpp
IndexTests.cpp
JSONTransportTests.cpp
ParsedASTTests.cpp
PathMappingTests.cpp
PrintASTTests.cpp
QualityTests.cpp
RenameTests.cpp
RIFFTests.cpp
SelectionTests.cpp
SemanticHighlightingTests.cpp
SemanticSelectionTests.cpp
SerializationTests.cpp
SourceCodeTests.cpp
SymbolCollectorTests.cpp
SymbolInfoTests.cpp
SyncAPI.cpp
2018-07-25 18:34:57 +08:00
TUSchedulerTests.cpp
TestFS.cpp
[clangd] DexIndex implementation prototype This patch is a proof-of-concept Dex index implementation. It has several flaws, which don't allow replacing static MemIndex yet, such as: * Not being able to handle queries of small size (less than 3 symbols); a way to solve this is generating trigrams of smaller size and having such incomplete trigrams in the index structure. * Speed measurements: while manually editing files in Vim and requesting autocompletion gives an impression that the performance is at least comparable with the current static index, having actual numbers is important because we don't want to hurt the users and roll out slow code. Eric (@ioeric) suggested that we should only replace MemIndex as soon as we have the evidence that this is not a regression in terms of performance. An approach which is likely to be successful here is to wait until we have benchmark library in the LLVM core repository, which is something I have suggested in the LLVM mailing lists, received positive feedback on and started working on. I will add a dependency as soon as the suggested patch is out for a review (currently there's at least one complication which is being addressed by https://github.com/google/benchmark/pull/649). Key performance improvements for iterators are sorting by cost and the limit iterator. * Quality measurements: currently, boosting iterator and two-phase lookup stage are not implemented, without these the quality is likely to be worse than the current implementation can yield. Measuring quality is tricky, but another suggestion in the offline discussion was that the drop-in replacement should only happen after Boosting iterators implementation (and subsequent query enhancement). The proposed changes do not affect Clangd functionality or performance, `DexIndex` is only used in unit tests and not in production code. Reviewed by: ioeric Differential Revision: https://reviews.llvm.org/D50337 llvm-svn: 340175
2018-08-20 22:39:32 +08:00
TestIndex.cpp
TestTU.cpp
ThreadingTests.cpp
TraceTests.cpp
TypeHierarchyTests.cpp
TweakTests.cpp
TweakTesting.cpp
URITests.cpp
XRefsTests.cpp
$<TARGET_OBJECTS:obj.clangDaemonTweaks>
)
clang_target_link_libraries(ClangdTests
[CMake] Use PRIVATE in target_link_libraries for executables We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 llvm-svn: 319840
2017-12-06 05:49:56 +08:00
PRIVATE
clangAST
clangBasic
clangFormat
clangFrontend
clangIndex
clangLex
clangSema
clangSerialization
clangTooling
clangToolingCore
clangToolingInclusions
clangToolingRefactoring
clangToolingSyntax
)
target_link_libraries(ClangdTests
PRIVATE
clangDaemon
clangTidy
LLVMSupport
LLVMTestingSupport
)
if (CLANGD_BUILD_XPC)
add_subdirectory(xpc)
endif ()
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)