]> granicus.if.org Git - llvm/commit
[lit] Extend internal diff to support -U
authorJoel E. Denny <jdenny.ornl@gmail.com>
Mon, 14 Oct 2019 19:59:30 +0000 (19:59 +0000)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Mon, 14 Oct 2019 19:59:30 +0000 (19:59 +0000)
commit9ef9df39b3b35e921db21f8a6b00ec1fbe9e8ed5
treeb655ec219220aaf32526fa5ed9a735d9166dcdd3
parenta8b14d4c5881084c18b141f6f5be0f5485bbbe7d
[lit] Extend internal diff to support -U

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 -U1 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 `-U` as a command-line option.  This patch adds `-U`
support.

Reviewed By: rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374814 91177308-0d34-0410-b5e6-96231b3b80d8
utils/lit/lit/TestRunner.py
utils/lit/tests/Inputs/shtest-shell/diff-unified-error-0.txt [new file with mode: 0644]
utils/lit/tests/Inputs/shtest-shell/diff-unified-error-1.txt [new file with mode: 0644]
utils/lit/tests/Inputs/shtest-shell/diff-unified.txt [new file with mode: 0644]
utils/lit/tests/max-failures.py
utils/lit/tests/shtest-shell.py