Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang-tools-extra/clangd/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set(CLANGD_TEST_DEPS
ClangdTests
clangd-indexer
split-file
IndexBenchmark
)

if(CLANGD_BUILD_XPC)
Expand Down
4 changes: 3 additions & 1 deletion clang-tools-extra/clangd/test/include-cleaner-batch-fix.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
# RUN: cp -r %S/Inputs/include-cleaner %t/include
# RUN: echo '-I%t/include' > %t/compile_flags.txt
# Create a config file enabling include-cleaner features.
# RUN: echo $'Diagnostics:\n UnusedIncludes: Strict\n MissingIncludes: Strict' >> %t/clangd/config.yaml
# RUN: echo 'Diagnostics:' > %t/clangd/config.yaml
# RUN: echo ' UnusedIncludes: Strict' >> %t/clangd/config.yaml
# RUN: echo ' MissingIncludes: Strict' >> %t/clangd/config.yaml

# RUN: env XDG_CONFIG_HOME=%t clangd -lit-test -enable-config --compile-commands-dir=%t < %s | FileCheck -strict-whitespace %s
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{"workspace":{"workspaceEdit":{"documentChanges":true, "changeAnnotationSupport":{"groupsOnLabel":true}}}},"trace":"off"}}
Expand Down
8 changes: 4 additions & 4 deletions clang-tools-extra/clangd/test/index-tools.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Paths are not constructed correctly for the test to run on Windows.
# UNSUPPORTED: system-windows
# 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
# RUN: %clangd-benchmark-dir/IndexBenchmark %t.index %p/Inputs/requests.json --benchmark_min_time=0.01
# Pass invalid JSON file and check that IndexBenchmark fails to parse it.
# RUN: if [ -f %clangd-benchmark-dir/IndexBenchmark ]; then not %clangd-benchmark-dir/IndexBenchmark %t.index %t --benchmark_min_time=0.01 ; fi
# RUN: not %clangd-benchmark-dir/IndexBenchmark %t.index %t --benchmark_min_time=0.01
15 changes: 14 additions & 1 deletion clang-tools-extra/clangd/test/lit.cfg.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import os

import lit.llvm

lit.llvm.initialize(lit_config, config)
lit.llvm.llvm_config.clang_setup()
lit.llvm.llvm_config.use_default_substitutions()

# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
#
# We prefer the lit internal shell which provides a better user experience on failures
# and is faster unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0
# env var.
use_lit_shell = True
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
if lit_shell_env:
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)

config.name = "Clangd"
config.suffixes = [".test"]
config.excludes = ["Inputs"]
config.test_format = lit.formats.ShTest(not lit.llvm.llvm_config.use_lit_shell)
config.test_format = lit.formats.ShTest(not use_lit_shell)
config.test_source_root = config.clangd_source_dir + "/test"
config.test_exec_root = config.clangd_binary_dir + "/test"

Expand Down
3 changes: 2 additions & 1 deletion clang-tools-extra/clangd/test/system-include-extractor.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

# Create a bin directory to store the mock-driver and add it to the path
# RUN: mkdir -p %t.dir/bin
# RUN: export PATH=%t.dir/bin:$PATH
# RUN: %python -c "print(__import__('os').environ['PATH'])" > %t.path
# RUN: export PATH=%t.dir/bin:%{readfile:%t.path}
# Generate a mock-driver that will print %temp_dir%/my/dir and
# %temp_dir%/my/dir2 as include search paths.
# RUN: echo '#!/bin/sh' >> %t.dir/bin/my_driver.sh
Expand Down
Loading