Skip to content

Commit ca50832

Browse files
Reapply "[clangd] Enable lit internal shell by default"
This reverts commit 4cfbc44. There was an issue setting up the PATH variable in system-include-extractor.test which prevented chmod from being resolved.
1 parent 184416b commit ca50832

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

clang-tools-extra/clangd/test/lit.cfg.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1+
import os
2+
13
import lit.llvm
24
import lit.util
35

46
lit.llvm.initialize(lit_config, config)
57
lit.llvm.llvm_config.clang_setup()
68
lit.llvm.llvm_config.use_default_substitutions()
79

10+
# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
11+
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
12+
#
13+
# We prefer the lit internal shell which provides a better user experience on failures
14+
# and is faster unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0
15+
# env var.
16+
use_lit_shell = True
17+
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
18+
if lit_shell_env:
19+
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
20+
821
config.name = "Clangd"
922
config.suffixes = [".test"]
1023
config.excludes = ["Inputs"]
11-
config.test_format = lit.formats.ShTest(not lit.llvm.llvm_config.use_lit_shell)
24+
config.test_format = lit.formats.ShTest(not use_lit_shell)
1225
config.test_source_root = config.clangd_source_dir + "/test"
1326
config.test_exec_root = config.clangd_binary_dir + "/test"
1427

clang-tools-extra/clangd/test/system-include-extractor.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Create a bin directory to store the mock-driver and add it to the path
77
# RUN: mkdir -p %t.dir/bin
8-
# RUN: %python -c "print(__import__('os').environ['PATH'])" > %t.path
8+
# RUN: %python -c "print(__import__('os').environ['PATH'])" | tr -d '\n' > %t.path
99
# RUN: export PATH=%t.dir/bin:%{readfile:%t.path}
1010
# Generate a mock-driver that will print %temp_dir%/my/dir and
1111
# %temp_dir%/my/dir2 as include search paths.

0 commit comments

Comments
 (0)