[PATCH] D156954: [lit] Improve test output from lit's internal shell

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 16:36:02 PDT 2023


jdenny updated this revision to Diff 547990.
jdenny edited the summary of this revision.
jdenny added a comment.

Improve test coverage for new behavior.  Fix issues that revealed:

- Drive-by fix that came up in testing: internal `not cmd` sometimes produced exit status of `True`.  Fixed that to be `1`.
- Instead of `# command line`, add `# preamble command line` before command lines from `preamble_commands`.
- When expanding `%dbg(...)`, don't modify the original script.  Otherwise, upon every retry (due to `ALLOW_RETRIES`), we keep prepending the generic `# command line` to it as if there was no `%dbg(...)`.
- Assert that `%dbg(...)` is never missing.  ninja check-lit doesn't fail this assert.  CI testing will hopefully answer this question for all other uses.
- If `@echo` has any unexpected results, instead of failing a generic assertion and losing the specific diagnostic, enable the normal execution trace as if it's `echo`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156954/new/

https://reviews.llvm.org/D156954

Files:
  llvm/utils/lit/lit/TestRunner.py
  llvm/utils/lit/tests/Inputs/lit-opts/lit.cfg
  llvm/utils/lit/tests/Inputs/shtest-define/examples/param-subst.txt
  llvm/utils/lit/tests/Inputs/shtest-define/expansion-order.txt
  llvm/utils/lit/tests/Inputs/shtest-define/line-number-substitutions.txt
  llvm/utils/lit/tests/Inputs/shtest-define/name-chars.txt
  llvm/utils/lit/tests/Inputs/shtest-define/recursiveExpansionLimit.txt
  llvm/utils/lit/tests/Inputs/shtest-define/value-equals.txt
  llvm/utils/lit/tests/Inputs/shtest-define/value-escaped.txt
  llvm/utils/lit/tests/Inputs/shtest-define/ws-and-continuations.txt
  llvm/utils/lit/tests/Inputs/shtest-if-else/test.txt
  llvm/utils/lit/tests/Inputs/shtest-output-printing/basic.txt
  llvm/utils/lit/tests/Inputs/shtest-output-printing/lit.cfg
  llvm/utils/lit/tests/Inputs/shtest-output-printing/write-a-lot.py
  llvm/utils/lit/tests/Inputs/shtest-shell/echo-at-redirect-stderr.txt
  llvm/utils/lit/tests/Inputs/shtest-shell/echo-at-redirect-stdin.txt
  llvm/utils/lit/tests/Inputs/shtest-shell/echo-redirect-stderr.txt
  llvm/utils/lit/tests/Inputs/shtest-shell/echo-redirect-stdin.txt
  llvm/utils/lit/tests/allow-retries.py
  llvm/utils/lit/tests/lit-opts.py
  llvm/utils/lit/tests/shtest-define.py
  llvm/utils/lit/tests/shtest-env.py
  llvm/utils/lit/tests/shtest-format.py
  llvm/utils/lit/tests/shtest-if-else.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-pushd-popd.py
  llvm/utils/lit/tests/shtest-recursive-substitution.py
  llvm/utils/lit/tests/shtest-run-at-line.py
  llvm/utils/lit/tests/shtest-shell.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156954.547990.patch
Type: text/x-patch
Size: 100577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230807/7d0b833c/attachment-0001.bin>


More information about the llvm-commits mailing list