[PATCH] D154984: [lit] Drop "Script:", make -v and -a imply -vv

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 09:52:08 PDT 2023


jdenny created this revision.
jdenny added reviewers: Endill, jhenderson, yln, ldionne, aaron.ballman, awarzynski, MaskRay, rnk, mstorsjo, asavonic.
Herald added a subscriber: delcypher.
Herald added a project: All.
jdenny requested review of this revision.
Herald added a project: LLVM.

**Motivation**: -a shows output from all tests, and -v shows output
from just failed tests.  Without this patch, that output from each
test includes a section called "Script:", which includes all shell
commands that lit has computed from RUN directives and will attempt to
run for that test.  The effect of -vv (which also implies -v if
neither -a or -v is specified) is to extend that output with shell
commands as they are executing so you can easily see which one failed.
In that case, all shell commands that actually execute appear in the 
output twice, once for "Script:" and once for -vv.  Especially for 
tests with many RUN directives, the result is noisy.  When searching
through the output for a particular shell command, it is easy to get 
lost and mistake shell commands under "Script:" for shell commands
that actually executed.

**Change**: After this patch, there is no "Script:" section, -a and -v
imply -vv, and -vv is deprecated because it is just an alias for -v. 
That is, instead of always including all shell commands that might
execute, a test's output (if shown by -a or -v) always includes all 
shell commands as they execute because the latter is more useful.  The 
output never includes both because that is noisy and confusing.

**Secondary motivation**: We are also working to introduce a PYTHON
directive, which can appear between RUN directives.  How should PYTHON
directives be represented in the "Script:" section, which has 
previously been just a shell script?  We could probably think of
something, but adding info about PYTHON directive execution in the -vv 
trace seems more straight-forward and more useful.

(This patch also removes a confusing point in the -vv documentation:
at least when using bash as an external shell, -vv echoes commands to
the shell's stderr not stdout.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154984

Files:
  llvm/docs/CommandGuide/lit.rst
  llvm/utils/lit/lit/LitConfig.py
  llvm/utils/lit/lit/TestRunner.py
  llvm/utils/lit/lit/cl_arguments.py
  llvm/utils/lit/lit/main.py
  llvm/utils/lit/tests/Inputs/shtest-if-else/test.txt
  llvm/utils/lit/tests/shtest-format.py
  llvm/utils/lit/tests/shtest-inject.py
  llvm/utils/lit/tests/shtest-not.py
  llvm/utils/lit/tests/shtest-output-printing.py
  llvm/utils/lit/tests/shtest-run-at-line.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154984.539158.patch
Type: text/x-patch
Size: 19507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230711/4e4ba470/attachment.bin>


More information about the llvm-commits mailing list