[Mlir-commits] [mlir] [polly] [mlir][polly][llvm-lit] Fixed logic for turning on external shell in lit (PR #106458)

Connie Zhu llvmlistbot at llvm.org
Thu Aug 29 14:59:02 PDT 2024


https://github.com/connieyzhu updated https://github.com/llvm/llvm-project/pull/106458

>From 490393323c2540ea06a2634ca4081f975c3e8610 Mon Sep 17 00:00:00 2001
From: Connie Zhu <connieyzhu at google.com>
Date: Wed, 28 Aug 2024 21:18:39 +0000
Subject: [PATCH 1/3] [mlir][polly][llvm-lit] Fixed logic for turning on
 external shell in lit

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.
---
 mlir/test/lit.cfg.py       | 2 +-
 polly/test/UnitIsl/lit.cfg | 2 +-
 polly/test/lit.cfg         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py
index 98d0ddd9a2be11..81a668e73d4b24 100644
--- a/mlir/test/lit.cfg.py
+++ b/mlir/test/lit.cfg.py
@@ -23,7 +23,7 @@
 use_lit_shell = True
 lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
 if lit_shell_env:
-  use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)
+  use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
 
 config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
 
diff --git a/polly/test/UnitIsl/lit.cfg b/polly/test/UnitIsl/lit.cfg
index 0944d543572d86..a3aa24db45f7cd 100644
--- a/polly/test/UnitIsl/lit.cfg
+++ b/polly/test/UnitIsl/lit.cfg
@@ -22,7 +22,7 @@ config.name = 'Polly - isl unit tests'
 use_lit_shell = True
 lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
 if lit_shell_env:
-  use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)
+  use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
 
 config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
 
diff --git a/polly/test/lit.cfg b/polly/test/lit.cfg
index 156c1f97f5d3ae..fb9d404a4c6717 100644
--- a/polly/test/lit.cfg
+++ b/polly/test/lit.cfg
@@ -25,7 +25,7 @@ config.name = 'Polly'
 use_lit_shell = True
 lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
 if lit_shell_env:
-  use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)
+  use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
 
 config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
 

>From 7b5174e9adbbb1340f53ece3d6df9e4db5868fd2 Mon Sep 17 00:00:00 2001
From: Connie Zhu <connieyzhu at google.com>
Date: Wed, 28 Aug 2024 21:27:46 +0000
Subject: [PATCH 2/3] [NFC] Python indendation styling fixes

---
 mlir/test/lit.cfg.py       | 2 +-
 polly/test/UnitIsl/lit.cfg | 2 +-
 polly/test/lit.cfg         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py
index 81a668e73d4b24..930e4eb0aed68f 100644
--- a/mlir/test/lit.cfg.py
+++ b/mlir/test/lit.cfg.py
@@ -23,7 +23,7 @@
 use_lit_shell = True
 lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
 if lit_shell_env:
-  use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
+    use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
 
 config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
 
diff --git a/polly/test/UnitIsl/lit.cfg b/polly/test/UnitIsl/lit.cfg
index a3aa24db45f7cd..d91edfbaf4f944 100644
--- a/polly/test/UnitIsl/lit.cfg
+++ b/polly/test/UnitIsl/lit.cfg
@@ -22,7 +22,7 @@ config.name = 'Polly - isl unit tests'
 use_lit_shell = True
 lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
 if lit_shell_env:
-  use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
+	use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
 
 config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
 
diff --git a/polly/test/lit.cfg b/polly/test/lit.cfg
index fb9d404a4c6717..c3f984b5c7f127 100644
--- a/polly/test/lit.cfg
+++ b/polly/test/lit.cfg
@@ -25,7 +25,7 @@ config.name = 'Polly'
 use_lit_shell = True
 lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
 if lit_shell_env:
-  use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
+    use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
 
 config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
 

>From 5d1054a786ce175df569d16c5c02972644c08f68 Mon Sep 17 00:00:00 2001
From: Connie Zhu <connieyzhu at google.com>
Date: Thu, 29 Aug 2024 21:58:02 +0000
Subject: [PATCH 3/3] Added TODOs to consolidate logic for enabling internal
 shell

---
 mlir/test/lit.cfg.py       | 3 +++
 polly/test/UnitIsl/lit.cfg | 3 +++
 polly/test/lit.cfg         | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py
index 930e4eb0aed68f..f0d4f35ba3e229 100644
--- a/mlir/test/lit.cfg.py
+++ b/mlir/test/lit.cfg.py
@@ -18,6 +18,9 @@
 # name: The name of this test suite.
 config.name = "MLIR"
 
+# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
+# See https://github.com/llvm/llvm-project/issues/106636 for more details.
+#
 # We prefer the lit internal shell which provides a better user experience on failures
 # unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var.
 use_lit_shell = True
diff --git a/polly/test/UnitIsl/lit.cfg b/polly/test/UnitIsl/lit.cfg
index d91edfbaf4f944..4b68f1460c3d83 100644
--- a/polly/test/UnitIsl/lit.cfg
+++ b/polly/test/UnitIsl/lit.cfg
@@ -17,6 +17,9 @@ config.name = 'Polly - isl unit tests'
 # For now we require '&&' between commands, until they get globally killed and
 # the test runner updated.
 #
+# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
+# See https://github.com/llvm/llvm-project/issues/106636 for more details.
+#
 # We prefer the lit internal shell which provides a better user experience on failures
 # unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var.
 use_lit_shell = True
diff --git a/polly/test/lit.cfg b/polly/test/lit.cfg
index c3f984b5c7f127..075ebdacbdc946 100644
--- a/polly/test/lit.cfg
+++ b/polly/test/lit.cfg
@@ -20,6 +20,9 @@ config.name = 'Polly'
 # For now we require '&&' between commands, until they get globally killed and
 # the test runner updated.
 #
+# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
+# See https://github.com/llvm/llvm-project/issues/106636 for more details.
+#
 # We prefer the lit internal shell which provides a better user experience on failures
 # unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var.
 use_lit_shell = True



More information about the Mlir-commits mailing list