Skip to content

Commit 6b86f51

Browse files
authored
[polly][llvm-lit] Enabled lit internal shell for polly test suite (#105704)
This patch sets lit's internal shell to be the default shell when running polly tests. This is one of the milestones to resolving the meta-issue: #102704.
1 parent ed2f909 commit 6b86f51

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

polly/test/UnitIsl/lit.cfg

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ config.name = 'Polly - isl unit tests'
1616
#
1717
# For now we require '&&' between commands, until they get globally killed and
1818
# the test runner updated.
19-
execute_external = platform.system() != 'Windows'
20-
config.test_format = lit.formats.ShTest(execute_external)
19+
#
20+
# We prefer the lit internal shell which provides a better user experience on failures
21+
# unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var.
22+
use_lit_shell = True
23+
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
24+
if lit_shell_env:
25+
use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)
26+
27+
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
2128

2229
# suffixes: A list of file extensions to treat as test files.
2330
config.suffixes = ['.sh']

polly/test/lit.cfg

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ config.name = 'Polly'
1919
#
2020
# For now we require '&&' between commands, until they get globally killed and
2121
# the test runner updated.
22-
execute_external = platform.system() != 'Windows'
23-
config.test_format = lit.formats.ShTest(execute_external)
22+
#
23+
# We prefer the lit internal shell which provides a better user experience on failures
24+
# unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 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 = not lit.util.pythonize_bool(lit_shell_env)
29+
30+
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
2431

2532
# suffixes: A list of file extensions to treat as test files.
2633
config.suffixes = ['.ll']

0 commit comments

Comments
 (0)