[PATCH] D95670: [clangd] Don't rely on builtin headers for document-link.test.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 28 23:55:16 PST 2021
hokein created this revision.
hokein added a reviewer: kadircet.
Herald added subscribers: usaxena95, arphaman.
hokein requested review of this revision.
Herald added subscribers: MaskRay, ilya-biryukov.
Herald added a project: clang.
This test seems to be failing at HEAD.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D95670
Files:
clang-tools-extra/clangd/test/document-link.test
Index: clang-tools-extra/clangd/test/document-link.test
===================================================================
--- clang-tools-extra/clangd/test/document-link.test
+++ clang-tools-extra/clangd/test/document-link.test
@@ -1,9 +1,10 @@
-# for %resource_dir: REQUIRES: clang
-# %resource_dir actually points at builtin_include_dir, go up one directory.
-# RUN: clangd -lit-test -resource-dir=%resource_dir/.. < %s | FileCheck -strict-whitespace %s
+
+# create a fake resource_dir so that the test can find the headers.
+# RUN: mkdir -p %t/include/ && touch %t/include/foo.h
+# RUN: clangd -lit-test -resource-dir=%t < %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":"#include <stdint.h>\n#include <stddef.h>"}}}
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"#include <foo.h>"}}}
---
{"jsonrpc":"2.0","id":2,"method":"textDocument/documentLink","params":{"textDocument":{"uri":"test:///main.cpp"}}}
# CHECK: "id": 2,
@@ -12,7 +13,7 @@
# CHECK-NEXT: {
# CHECK-NEXT: "range": {
# CHECK-NEXT: "end": {
-# CHECK-NEXT: "character": 19,
+# CHECK-NEXT: "character": 16,
# CHECK-NEXT: "line": 0
# CHECK-NEXT: },
# CHECK-NEXT: "start": {
@@ -20,20 +21,7 @@
# CHECK-NEXT: "line": 0
# CHECK-NEXT: }
# CHECK-NEXT: },
-# CHECK-NEXT: "target": "file://{{.*}}/stdint.h"
-# CHECK-NEXT: },
-# CHECK-NEXT: {
-# CHECK-NEXT: "range": {
-# CHECK-NEXT: "end": {
-# CHECK-NEXT: "character": 19,
-# CHECK-NEXT: "line": 1
-# CHECK-NEXT: },
-# CHECK-NEXT: "start": {
-# CHECK-NEXT: "character": 9,
-# CHECK-NEXT: "line": 1
-# CHECK-NEXT: }
-# CHECK-NEXT: },
-# CHECK-NEXT: "target": "file://{{.*}}/stddef.h"
+# CHECK-NEXT: "target": "file://{{.*}}/foo.h"
# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK-NEXT:}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95670.320060.patch
Type: text/x-patch
Size: 2236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210129/b64762e0/attachment.bin>
More information about the cfe-commits
mailing list