Open tahonermann opened 2 weeks ago
@Harini0924, it appears that you recently added the support for env
to be used without a subcommand in commit https://github.com/llvm/llvm-project/commit/178392454e076624674b4a7ddf3fc8bda2e94f0e. Perhaps you could take a look? I think the problem is that the return 0
here is circumventing further processing of the command pipeline.
LLVM's
lit
utility includes a builtin implementation of theenv
command inllvm/utils/lit/lit/TestRunner.py
; see here. When theenv
command is used without a subcommand argument, the behavior is to print the (possibly augmented) environment to stdout. Lit's builtin implementation does this, but further processing of the command pipeline is then skipped.The existing
llvm/utils/lit/tests/shtest-env-positive.py
test (in conjunction withllvm/utils/lit/tests/Inputs/shtest-env-positive/env-no-subcommand.txt
) appears to exercise this situation, but the test actually passes spuriously. This can be demonstrated in several ways. First by observing that "executed command" log output is not generated for commands that follow theenv
command in a pipeline, and second by augmenting the test in a way that should cause the test to fail, but doesn't.To demonstrate the issue, here first is an invocation of the
llvm/utils/lit/tests/shtest-env-positive.py
test (on Linux) that shows that "execute command" log output should appear for each command in the pipeline. Note that the command pipeline to run in this case is of the formenv ... python ... | FileCheck ...
and the log output reflects both commands from the pipeline.The following demonstrates an independent run of the
llvm/utils/lit/tests/Inputs/shtest-env-positive/env-no-subcommand.txt
test. Note that the output does not include "executed command" logs for theFileCheck
portions of the pipelines in that test. The test exercises five distinct scenarios but I've only included output from the first. Note that the command to run in the pipeline is of the formenv | FileCheck ...
, but the log output only reflects theenv
command from the pipeline; theFileCheck
command is skipped.The following demonstrates that a modification to the test that should cause it to fail does not do so. Apply the following diff (or make similar changes) and observe that the test still passes.