<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/106459>106459</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir][polly][llvm-lit] External shell unable to be turned on for lit tests
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
connieyzhu
</td>
</tr>
</table>
<pre>
In both mlir and polly, tests are run with lit's internal shell by default. In order to use the external shell instead, the `LIT_USE_INTERNAL_SHELL` environment variable should be set to 0. The logic in the lit configs of these test suites prevents the external shell from being turned on.
Code:
```
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)
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
```
The problem lies in the body of the if statement, with the use of `not`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U02PozgQ_TXmUhpkDCRw4DDTSbSRoj5sZ8_IhAK8MnZkl7Od_vUrQ7pb0e5IkUO5yq--3pPeq9EgNqz8xcpdIgNN1jUXa4zC-8cUks729-ZooLM0wayVA2l6uFqt70y8AKEnD9IhuGDgH0UTaEVMbD0oQ-iM1OAn1Bq6O_Q4yKAphaMB63p0QBaCR6AJAd-fwpXxhLJfckwIbMNPx3P719u-Pb6e93--_jy1b3_sTye24YDmppw1MxqCm3RKdhrBTzboHjoEjxQT8RTOE4K2o7qAMgusVgQXawY1erBDvIrVoCfwQRF6uDq8oSH_fyUOzs7QoTIjUHAGe7AmZXzH-M_1fLE9svxhsA1__BYzeGy1onaFYvkOzi7g6vu6b9HcFp_16aPJdERiomJC_GYeQjBRrzhqgCeo71p4_d_8xlIMTwMpnV7vNFmjPrDtrNVMVM9AnxnWc51gGufWDtbNkhbACLaaPn2bzuhj4fiOl0DYfs6S5buY-Kmcb_jnma1nXOLV2U7jDFqh_9xlZOpjiaAG8CQJIyUihRZiRkdkmx0inYwltuFp0jd5X-e1TLDJtqKoqowXVTI1RT9g3mV1mXPeZVm2FR1ucZNJLvp6UxSJagQXBa9EJbJ8K6q0RI6Cl3V1qaSoyowVHGepdKr1bU6tGxPlfcAm45uirBMtO9R-UZ4QUVlxdeUucU2M_9GF0bOCa-XJfyOQIr2odXlQ7lj5a9Xi8rk8jPord7B_JmswiyrIRkV80RUG6xYRLDpOgtPNRHT1kSniwMRhVDSFLr3YmYlDhH_8_bg6-zdeiInD0pRn4vDo69aIfwMAAP__RXFrhQ">