diff options
author | Haojian Wu <hokein@google.com> | 2018-11-28 13:31:05 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2018-11-28 13:31:05 +0000 |
commit | c32855cbb4728b4ce7d7b92f6014cb7f14a38062 (patch) | |
tree | b3ca0855192632e8d3e8a9372b53cc71778f0156 /clang-tools-extra/test | |
parent | a9b8dae397ed8d1f23cca90630ee1019f12e16bf (diff) |
[clangd] Build and test IndexBenchmark in check-clangd
Summary:
Include IndexBenchmark in check-clangd to make sure we won't forget to update
it when doing breaking changes; also fix an out-of-date test input.
Reviewers: ilya-biryukov
Subscribers: mgorny, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D54998
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r-- | clang-tools-extra/test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | clang-tools-extra/test/clangd/Inputs/requests.json | 14 | ||||
-rw-r--r-- | clang-tools-extra/test/clangd/index-tools.test | 1 |
3 files changed, 11 insertions, 8 deletions
diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt index 451c181fdf0..12442455f7a 100644 --- a/clang-tools-extra/test/CMakeLists.txt +++ b/clang-tools-extra/test/CMakeLists.txt @@ -72,6 +72,10 @@ set(CLANGD_TEST_DEPS dexp ) +if (LLVM_INCLUDE_BENCHMARKS) + list(APPEND CLANGD_TEST_DEPS IndexBenchmark) +endif() + # Add lit test dependencies. set(LLVM_UTILS_DEPS FileCheck count not diff --git a/clang-tools-extra/test/clangd/Inputs/requests.json b/clang-tools-extra/test/clangd/Inputs/requests.json index 3ddb9cb700e..ee91cf24374 100644 --- a/clang-tools-extra/test/clangd/Inputs/requests.json +++ b/clang-tools-extra/test/clangd/Inputs/requests.json @@ -1,7 +1,7 @@ -[{"Limit":100,"ProximityPaths":["/usr/home/user/clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp"],"Query":"OMP","RestrictForCodeCompletion":true,"Scopes":["clang::"]}, -{"Limit":100,"ProximityPaths":[],"Query":"s","RestrictForCodeCompletion":true,"Scopes":["llvm::", ""]}, -{"Limit":100,"ProximityPaths":[],"Query":"sy","RestrictForCodeCompletion":true,"Scopes":["llvm::", ""]}, -{"Limit":100,"ProximityPaths":[],"Query":"sys","RestrictForCodeCompletion":true,"Scopes":["llvm::", ""]}, -{"Limit":100,"ProximityPaths":[],"Query":"sys","RestrictForCodeCompletion":true,"Scopes":["llvm::", ""]}, -{"Limit":100,"ProximityPaths":[],"Query":"Dex","RestrictForCodeCompletion":true,"Scopes":["clang::clangd::", "clang::", "clang::clangd::dex::"]}, -{"Limit":100,"ProximityPaths":[],"Query":"Variable","RestrictForCodeCompletion":true,"Scopes":[""]}] +[{"Limit":100,"ProximityPaths":["/usr/home/user/clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp"],"Query":"OMP","RestrictForCodeCompletion":true,"Scopes":["clang::"], "AnyScope":false}, +{"Limit":100,"ProximityPaths":[],"Query":"s","RestrictForCodeCompletion":true,"Scopes":["llvm::", ""], "AnyScope":false}, +{"Limit":100,"ProximityPaths":[],"Query":"sy","RestrictForCodeCompletion":true,"Scopes":["llvm::", ""], "AnyScope":false}, +{"Limit":100,"ProximityPaths":[],"Query":"sys","RestrictForCodeCompletion":true,"Scopes":["llvm::", ""], "AnyScope":false}, +{"Limit":100,"ProximityPaths":[],"Query":"sys","RestrictForCodeCompletion":true,"Scopes":["llvm::", ""], "AnyScope":false}, +{"Limit":100,"ProximityPaths":[],"Query":"Dex","RestrictForCodeCompletion":true,"Scopes":["clang::clangd::", "clang::", "clang::clangd::dex::"],"AnyScope":false}, +{"Limit":100,"ProximityPaths":[],"Query":"Variable","RestrictForCodeCompletion":true,"Scopes":[""], "AnyScope":false}] diff --git a/clang-tools-extra/test/clangd/index-tools.test b/clang-tools-extra/test/clangd/index-tools.test index 93cf56fea37..ff6e6748c1f 100644 --- a/clang-tools-extra/test/clangd/index-tools.test +++ b/clang-tools-extra/test/clangd/index-tools.test @@ -1,5 +1,4 @@ # RUN: clangd-indexer %p/Inputs/BenchmarkSource.cpp -- -I%p/Inputs > %t.index -# FIXME: By default, benchmarks are excluded from the list of default targets hence not built. Find a way to depend on benchmarks to run the next command. # REQUIRES: shell # RUN: if [ -f %clangd-benchmark-dir/IndexBenchmark ]; then %clangd-benchmark-dir/IndexBenchmark %t.index %p/Inputs/requests.json --benchmark_min_time=0.01 ; fi # Pass invalid JSON file and check that IndexBenchmark fails to parse it. |