diff options
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r-- | clang-tools-extra/test/CMakeLists.txt | 9 | ||||
-rw-r--r-- | clang-tools-extra/test/clangd/xpc/initialize.test | 10 | ||||
-rw-r--r-- | clang-tools-extra/test/lit.cfg | 4 | ||||
-rw-r--r-- | clang-tools-extra/test/lit.site.cfg.in | 1 |
4 files changed, 22 insertions, 2 deletions
diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt index 451c181fdf05..adeb0368f893 100644 --- a/clang-tools-extra/test/CMakeLists.txt +++ b/clang-tools-extra/test/CMakeLists.txt @@ -16,7 +16,8 @@ endif () string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) llvm_canonicalize_cmake_booleans( - CLANG_ENABLE_STATIC_ANALYZER) + CLANG_ENABLE_STATIC_ANALYZER + CLANGD_BUILD_XPC_SUPPORT) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in @@ -61,7 +62,11 @@ set(CLANG_TOOLS_TEST_DEPS clang-headers clang-tidy - ) +) + +if(CLANGD_BUILD_XPC_SUPPORT) + list(APPEND CLANG_TOOLS_TEST_DEPS clangd-xpc-test-client) +endif() set(CLANGD_TEST_DEPS clangd diff --git a/clang-tools-extra/test/clangd/xpc/initialize.test b/clang-tools-extra/test/clangd/xpc/initialize.test new file mode 100644 index 000000000000..44bef65b12fd --- /dev/null +++ b/clang-tools-extra/test/clangd/xpc/initialize.test @@ -0,0 +1,10 @@ +# RUN: clangd-xpc-test-client < %s | FileCheck %s +# REQUIRES: clangd-xpc-support + +{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootUri":"test:///workspace","capabilities":{},"trace":"off"}} +# CHECK: {"id":0,"jsonrpc":"2.0","result":{"capabilities" + +{"jsonrpc":"2.0","id":3,"method":"shutdown"} +# CHECK: {"id":3,"jsonrpc":"2.0","result":null} + +{"jsonrpc":"2.0","method":"exit"} diff --git a/clang-tools-extra/test/lit.cfg b/clang-tools-extra/test/lit.cfg index 8f8ebaf98981..7fe56f7f2048 100644 --- a/clang-tools-extra/test/lit.cfg +++ b/clang-tools-extra/test/lit.cfg @@ -117,6 +117,10 @@ if not platform.system() in ['Windows'] or not execute_external: if platform.system() not in ['Windows']: config.available_features.add('ansi-escape-sequences') +# XPC support for Clangd. +if config.clangd_xpc_support: + config.available_features.add('clangd-xpc-support') + if config.clang_staticanalyzer: config.available_features.add('static-analyzer') diff --git a/clang-tools-extra/test/lit.site.cfg.in b/clang-tools-extra/test/lit.site.cfg.in index bf33b1513ecf..d71ca188a671 100644 --- a/clang-tools-extra/test/lit.site.cfg.in +++ b/clang-tools-extra/test/lit.site.cfg.in @@ -11,6 +11,7 @@ config.clang_libs_dir = "@SHLIBDIR@" config.python_executable = "@PYTHON_EXECUTABLE@" config.target_triple = "@TARGET_TRIPLE@" config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@ +config.clangd_xpc_support = @CLANGD_BUILD_XPC_SUPPORT@ # Support substitution of the tools and libs dirs with user parameters. This is # used when we can't determine the tool dir at configuration time. |