150
|
1 # We need to splice paths into file:// URIs for this test.
|
|
2 # UNSUPPORTED: windows-msvc
|
|
3
|
|
4 # Use a copy of inputs, as we'll mutate it (as will the background index).
|
|
5 # RUN: rm -rf %t
|
|
6 # RUN: cp -r %S/Inputs/background-index %t
|
|
7 # Need to embed the correct temp path in the actual JSON-RPC requests.
|
|
8 # RUN: sed -i -e "s|DIRECTORY|%t|" %t/definition.jsonrpc
|
|
9 # RUN: sed -i -e "s|DIRECTORY|%t|" %t/compile_commands.json
|
|
10
|
|
11 # We're editing bar.cpp, which includes foo.h.
|
|
12 # foo() is declared in foo.h and defined in foo.cpp.
|
|
13 # The background index should allow us to go-to-definition on foo().
|
|
14 # We should also see indexing progress notifications.
|
|
15 # RUN: clangd -background-index -lit-test < %t/definition.jsonrpc | FileCheck %t/definition.jsonrpc --check-prefixes=CHECK,BUILD
|
|
16
|
|
17 # Test that the index is writing files in the expected location.
|
|
18 # RUN: ls %t/.clangd/index/foo.cpp.*.idx
|
|
19 # RUN: ls %t/sub_dir/.clangd/index/foo.h.*.idx
|
|
20
|
|
21 # Test the index is read from disk: delete code and restart clangd.
|
|
22 # RUN: rm %t/foo.cpp
|
|
23 # RUN: clangd -background-index -lit-test < %t/definition.jsonrpc | FileCheck %t/definition.jsonrpc --check-prefixes=CHECK,USE
|