[PATCH] D66574: [lit] Make internal diff work in pipelines

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 19:43:51 PDT 2019


jdenny created this revision.
jdenny added reviewers: probinson, stella.stamenova, bd1976llvm, jlpeyton, rnk, mgorny.
Herald added a subscriber: delcypher.
Herald added a project: LLVM.

Without this patch, when using lit's internal shell, RUN lines like
the following would accidentally execute an external `diff` instead of
lit's internal `diff`:

  # RUN: program | diff file -
  # RUN: not diff file1 file2 | FileCheck %s

We are preparing patches to ensure lit's internal `diff` is called in
these cases, but that will break such uses because lit's internal
`diff` cannot be used in pipelines and doesn't recognize `-` as a
command-line option.

To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation.
Moreover, this patch implements `-` to mean stdin.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66574

Files:
  llvm/utils/lit/lit/TestRunner.py
  llvm/utils/lit/lit/builtin_commands/diff.py
  llvm/utils/lit/tests/Inputs/shtest-shell/diff-error-0.txt
  llvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes-0.txt
  llvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes-1.txt
  llvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes-2.txt
  llvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes-3.txt
  llvm/utils/lit/tests/Inputs/shtest-shell/diff-r-error-7.txt
  llvm/utils/lit/tests/Inputs/shtest-shell/diff-r-error-8.txt
  llvm/utils/lit/tests/max-failures.py
  llvm/utils/lit/tests/shtest-shell.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66574.216539.patch
Type: text/x-patch
Size: 28491 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190822/c337170f/attachment-0001.bin>


More information about the llvm-commits mailing list