Skip to content

Commit 2581354

Browse files
[llvm] Use lit internal shell by default
This should result in a 10-15% test time improvement and also richer test failure outputn on Linux where it is not yet the default. We can do this now that all of the tests have been ported over to work with lit's internal shell. Fixes #102697. Reviewers: ilovepi, petrhosek Reviewed By: ilovepi, petrhosek Pull Request: llvm/llvm-project#157237
1 parent 739de01 commit 2581354

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)