]> granicus.if.org Git - llvm/commit
[lit] Extend internal diff to support `-` argument
authorJoel E. Denny <jdenny.ornl@gmail.com>
Thu, 17 Oct 2019 14:03:06 +0000 (14:03 +0000)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Thu, 17 Oct 2019 14:03:06 +0000 (14:03 +0000)
commit2200a3278597d4fe5c18828c27fdbfdd852043e7
tree8b291bd88551f35251d675149f2d97e753b8cadc
parent80b7aace9f29deb93532c0b2ac1376dc1d0e3958
[lit] Extend internal diff to support `-` argument

When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-` as a command-line option.  This patch adds support for
`-` to mean stdin.

Reviewed By: probinson, rnk

Differential Revision: https://reviews.llvm.org/D67643

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375116 91177308-0d34-0410-b5e6-96231b3b80d8
utils/lit/lit/builtin_commands/diff.py
utils/lit/tests/Inputs/shtest-shell/diff-encodings.txt
utils/lit/tests/Inputs/shtest-shell/diff-pipes.txt
utils/lit/tests/Inputs/shtest-shell/diff-r-error-7.txt [new file with mode: 0644]
utils/lit/tests/Inputs/shtest-shell/diff-r-error-8.txt [new file with mode: 0644]
utils/lit/tests/max-failures.py
utils/lit/tests/shtest-shell.py