[llvm] [llvm-lit] Print environment variables when using env without subcommand (PR #98414)

Thomas Preud'homme via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 03:58:27 PDT 2024


RoboTux wrote:

> @jh7370 @RoboTux Thank you for the feedback earlier. To clarify, I'm implementing the tests by splitting them into two separate test files—one for positive tests and one for negative tests.
> 
>     * **Positive Tests:**  In the positive test file, I’m removing `not` from the RUN line (e.g., `# RUN: %{lit} -a -v %{inputs}/shtest-env-positive | FileCheck -match-full-lines %s`) and using `# CHECK-NOT: # error: `to ensure no errors occur.
> 
>     * **Negative Tests:**  In the negative test file, I will keep `not` in the RUN line (e.g., `# RUN: not %{lit} -a -v %{inputs}/shtest-env-negative | FileCheck -match-full-lines %s`) and will use `# CHECK: # error: command failed with exit status: {{.*}}`, since these tests are expected to fail and will have an error line.
> 
> 
> Additionally, I will be splitting `tests/Inputs/shtest-env` into `tests/Inputs/shtest-env-positive` and `tests/Inputs/shtest-env-negative`, with each containing their respective passing and failing tests.
> 
> Does this approach align with what you were suggesting? I want to make sure I'm on the right track.

Yes, that's exactly it. I'm not sure `CHECK-NOT: #error` is necessary for the positive case because I would expect lit to fail if any error is thrown but it cannot hurt.

https://github.com/llvm/llvm-project/pull/98414


More information about the llvm-commits mailing list