summaryrefslogtreecommitdiff
path: root/clang-tools-extra/test
diff options
context:
space:
mode:
authorJan Korous <jkorous@apple.com>2019-01-16 00:24:22 +0000
committerJan Korous <jkorous@apple.com>2019-01-16 00:24:22 +0000
commitde3bade227c6caf680cebb3fa995d017ad99a771 (patch)
treefeb25812c37ed5e408643d851fe177f5710160fc /clang-tools-extra/test
parentd6ecaee1815084cc81ec145677f085d1fa591afc (diff)
[clangd] XPC transport layer
- New transport layer for macOS. - XPC Framework - Test client Framework and client were written by Alex Lorenz. Differential Revision: https://reviews.llvm.org/D54428
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r--clang-tools-extra/test/CMakeLists.txt9
-rw-r--r--clang-tools-extra/test/clangd/xpc/initialize.test10
-rw-r--r--clang-tools-extra/test/lit.cfg4
-rw-r--r--clang-tools-extra/test/lit.site.cfg.in1
4 files changed, 22 insertions, 2 deletions
diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt
index 451c181fdf0..adeb0368f89 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 00000000000..44bef65b12f
--- /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 8f8ebaf9898..7fe56f7f204 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 bf33b1513ec..d71ca188a67 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.