summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/test/references.test
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2019-04-29 08:44:01 +0000
committerSam McCall <sam.mccall@gmail.com>2019-04-29 08:44:01 +0000
commitb804eef09052cf40e79aa2ed8a23f2f39e2dda1b (patch)
tree7315d3e6ad44c8898b9952d3fdaeb523ec47bf8b /clang-tools-extra/clangd/test/references.test
parente62915bcc1a1f40e9846f58388c2b32bee76000c (diff)
downloadbcm5719-llvm-b804eef09052cf40e79aa2ed8a23f2f39e2dda1b.tar.gz
bcm5719-llvm-b804eef09052cf40e79aa2ed8a23f2f39e2dda1b.zip
[clangd] Move clangd tests to clangd directory. check-clangd is no longer part of check-clang-tools.
Summary: Motivation: - this layout is a pain to work with - without a common root, it's painful to express things like "disable clangd" (D61122) - CMake/lit configs are a maintenance hazard, and the more the one-off hacks for various tools are entangled, the more we see apathy and non-ownership. This attempts to use the bare-minimum configuration needed (while still supporting the difficult cases: windows, standalone clang build, dynamic libs). In particular the lit.cfg.py and lit.site.cfg.py.in are merged into lit.cfg.in. The logic in these files is now minimal. (Much of clang-tools-extra's lit configs can probably be cleaned up by reusing lit.llvm.llvm_config.use_clang(), and every llvm project does its own version of LDPATH mangling. I haven't attempted to fix any of those). Docs are still in clang-tools-extra/docs, I don't have any plans to touch those. Reviewers: gribozavr Subscribers: mgorny, javed.absar, MaskRay, jkorous, arphaman, kadircet, jfb, cfe-commits, ilya-biryukov, thakis Tags: #clang Differential Revision: https://reviews.llvm.org/D61187 llvm-svn: 359424
Diffstat (limited to 'clang-tools-extra/clangd/test/references.test')
-rw-r--r--clang-tools-extra/clangd/test/references.test40
1 files changed, 40 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/test/references.test b/clang-tools-extra/clangd/test/references.test
new file mode 100644
index 00000000000..964f5e7f952
--- /dev/null
+++ b/clang-tools-extra/clangd/test/references.test
@@ -0,0 +1,40 @@
+# RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
+{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
+---
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"int x; int y = x;"}}}
+---
+{"jsonrpc":"2.0","id":1,"method":"textDocument/references","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":4}}}
+# CHECK: "id": 1
+# CHECK-NEXT: "jsonrpc": "2.0",
+# CHECK-NEXT: "result": [
+# CHECK-NEXT: {
+# CHECK-NEXT: "range": {
+# CHECK-NEXT: "end": {
+# CHECK-NEXT: "character": 5,
+# CHECK-NEXT: "line": 0
+# CHECK-NEXT: },
+# CHECK-NEXT: "start": {
+# CHECK-NEXT: "character": 4,
+# CHECK-NEXT: "line": 0
+# CHECK-NEXT: }
+# CHECK-NEXT: },
+# CHECK-NEXT: "uri": "{{.*}}/main.cpp"
+# CHECK-NEXT: },
+# CHECK-NEXT: {
+# CHECK-NEXT: "range": {
+# CHECK-NEXT: "end": {
+# CHECK-NEXT: "character": 16,
+# CHECK-NEXT: "line": 0
+# CHECK-NEXT: },
+# CHECK-NEXT: "start": {
+# CHECK-NEXT: "character": 15,
+# CHECK-NEXT: "line": 0
+# CHECK-NEXT: }
+# CHECK-NEXT: },
+# CHECK-NEXT: "uri": "{{.*}}/main.cpp"
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
+---
+{"jsonrpc":"2.0","id":3,"method":"shutdown"}
+---
+{"jsonrpc":"2.0","method":"exit"}
OpenPOWER on IntegriCloud