Skip to content

Commit 3fe1909

Browse files
[lld] Make lld tests use lit internal shell by default
This patch updates the lld lit test config to use the internal shell by default. This has some performance advantages (~10-15%) and also produces nicer failure output. This should have no impact on test coverage now that all tests previously requiring a shell have been ported over to work with the internal shell. Pull Request: llvm#156538
1 parent 303bea8 commit 3fe1909

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lld/test/lit.cfg.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,21 @@
1616
# name: The name of this test suite.
1717
config.name = "lld"
1818

19+
# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
20+
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
21+
#
22+
# We prefer the lit internal shell which provides a better user experience on failures
23+
# and is faster unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0
24+
# env var.
25+
use_lit_shell = True
26+
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
27+
if lit_shell_env:
28+
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
29+
1930
# testFormat: The test format to use to interpret tests.
2031
#
2132
# For now we require '&&' between commands, until they get globally killed and the test runner updated.
22-
config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
33+
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
2334

2435
# suffixes: A list of file extensions to treat as test files.
2536
config.suffixes = [".ll", ".s", ".test", ".yaml", ".objtxt"]

0 commit comments

Comments
 (0)