Skip to content

Commit e203138

Browse files
boomanaiden154aadeshps-mcw
authored andcommitted
[include-cleaner] Use lit internal shell by default for tests (llvm#169092)
All of the tests seem to be compatible with the internal shell and the internal shell is typically faster by 10-15% on top of providing a better debugging experience.
1 parent 34b01c6 commit e203138

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

clang-tools-extra/include-cleaner/test/lit.cfg.py

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

35
lit.llvm.initialize(lit_config, config)
46
lit.llvm.llvm_config.use_default_substitutions()
57

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

0 commit comments

Comments
 (0)