Skip to content

Commit f869d7a

Browse files
Reapply "[llvm] Use lit internal shell by default"
This reverts commit ee5bc57. This was causing test failures on Darwin due to printf there not supporting hex escapes. That has since been fixed in a separate patch.
1 parent 8f84295 commit f869d7a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

llvm/test/lit.cfg.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@
1717
# name: The name of this test suite.
1818
config.name = "LLVM"
1919

20+
# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
21+
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
22+
#
23+
# We prefer the lit internal shell which provides a better user experience on failures
24+
# and is faster unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0
25+
# env var.
26+
use_lit_shell = True
27+
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
28+
if lit_shell_env:
29+
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
30+
2031
# testFormat: The test format to use to interpret tests.
2132
extra_substitutions = extra_substitutions = (
2233
[
@@ -26,9 +37,7 @@
2637
if config.enable_profcheck
2738
else []
2839
)
29-
config.test_format = lit.formats.ShTest(
30-
not llvm_config.use_lit_shell, extra_substitutions
31-
)
40+
config.test_format = lit.formats.ShTest(not use_lit_shell, extra_substitutions)
3241

3342
# suffixes: A list of file extensions to treat as test files. This is overriden
3443
# by individual lit.local.cfg files in the test subdirectories.

0 commit comments

Comments
 (0)