[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
Wed Aug 28 14:30:05 PDT 2024


https://github.com/connieyzhu created https://github.com/llvm/llvm-project/pull/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.

>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/2] [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/2] [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)
 



More information about the Mlir-commits mailing list