Skip to content

Commit 18e5505

Browse files
authored
[mlir][polly][llvm-lit] Fixed logic for turning on external shell in lit (#106458)
For both mlir and polly, the lit internal shell is the default shell for running lit tests. However, if the user wanted to switch back to the external shell by setting `LIT_USE_INTERNAL_SHELL=0`, the `not` used in the body of the `if` conditional changes `use_lit_shell` to be True instead of the intended False. Removing `not` allows for this lit config to work as intended. Fixes #106459.
1 parent 941feb7 commit 18e5505

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

mlir/test/lit.cfg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
# name: The name of this test suite.
1919
config.name = "MLIR"
2020

21+
# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
22+
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
23+
#
2124
# We prefer the lit internal shell which provides a better user experience on failures
2225
# unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var.
2326
use_lit_shell = True
2427
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
2528
if lit_shell_env:
26-
use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)
29+
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
2730

2831
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
2932

polly/test/UnitIsl/lit.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ config.name = 'Polly - isl unit tests'
1717
# For now we require '&&' between commands, until they get globally killed and
1818
# the test runner updated.
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+
#
2023
# We prefer the lit internal shell which provides a better user experience on failures
2124
# unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var.
2225
use_lit_shell = True
2326
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
2427
if lit_shell_env:
25-
use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)
28+
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
2629

2730
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
2831

polly/test/lit.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ config.name = 'Polly'
2020
# For now we require '&&' between commands, until they get globally killed and
2121
# the test runner updated.
2222
#
23+
# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
24+
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
25+
#
2326
# We prefer the lit internal shell which provides a better user experience on failures
2427
# unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var.
2528
use_lit_shell = True
2629
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
2730
if lit_shell_env:
28-
use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)
31+
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
2932

3033
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
3134

0 commit comments

Comments
 (0)