annotate clang-tools-extra/clangd/test/background-index.test @ 180:680fa57a2f20

fix compile errors.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 30 May 2020 17:44:06 +0900
parents 1d019706d866
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 # We need to splice paths into file:// URIs for this test.
anatofuz
parents:
diff changeset
2 # UNSUPPORTED: windows-msvc
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 # Use a copy of inputs, as we'll mutate it (as will the background index).
anatofuz
parents:
diff changeset
5 # RUN: rm -rf %t
anatofuz
parents:
diff changeset
6 # RUN: cp -r %S/Inputs/background-index %t
anatofuz
parents:
diff changeset
7 # Need to embed the correct temp path in the actual JSON-RPC requests.
anatofuz
parents:
diff changeset
8 # RUN: sed -i -e "s|DIRECTORY|%t|" %t/definition.jsonrpc
anatofuz
parents:
diff changeset
9 # RUN: sed -i -e "s|DIRECTORY|%t|" %t/compile_commands.json
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 # We're editing bar.cpp, which includes foo.h.
anatofuz
parents:
diff changeset
12 # foo() is declared in foo.h and defined in foo.cpp.
anatofuz
parents:
diff changeset
13 # The background index should allow us to go-to-definition on foo().
anatofuz
parents:
diff changeset
14 # We should also see indexing progress notifications.
anatofuz
parents:
diff changeset
15 # RUN: clangd -background-index -lit-test < %t/definition.jsonrpc | FileCheck %t/definition.jsonrpc --check-prefixes=CHECK,BUILD
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 # Test that the index is writing files in the expected location.
anatofuz
parents:
diff changeset
18 # RUN: ls %t/.clangd/index/foo.cpp.*.idx
anatofuz
parents:
diff changeset
19 # RUN: ls %t/sub_dir/.clangd/index/foo.h.*.idx
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 # Test the index is read from disk: delete code and restart clangd.
anatofuz
parents:
diff changeset
22 # RUN: rm %t/foo.cpp
anatofuz
parents:
diff changeset
23 # RUN: clangd -background-index -lit-test < %t/definition.jsonrpc | FileCheck %t/definition.jsonrpc --check-prefixes=CHECK,USE