SuccessChanges

Summary

  1. [lit] Make internal diff work in pipelines (details)
  2. [lit] Extend internal diff to support `-` argument (details)
Commit b163806cdc317ee160a2ce694958c088a949fa7d by dennyje
[lit] Make internal diff work in pipelines
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 -
# RUN: not diff file1 file2 | FileCheck %s
```
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` cannot
currently 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.  A
follow-up patch will implement `-` to mean stdin.
Also, when lit's `diff` prints differences to stdout in Windows, this
patch ensures it always terminate lines with `\n` not `\r\n`.  That way,
strict FileCheck directives checking the `diff` output succeed in both
Linux and Windows.  This wasn't an issue when `diff` was internal to lit
because `diff` didn't then write to the true stdout, which is where the
`\n` -> `\r\n` conversion happened in Python.
Reviewed By: probinson, stella.stamenova
Differential Revision: https://reviews.llvm.org/D66574
The file was removedllvm/utils/lit/tests/Inputs/shtest-shell/diff-unified-error-1.txt
The file was removedllvm/utils/lit/tests/Inputs/shtest-shell/diff-unified-error-0.txt
The file was modifiedllvm/utils/lit/tests/Inputs/shtest-shell/diff-unified.txt
The file was addedllvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes.txt
The file was addedllvm/utils/lit/lit/builtin_commands/diff.py
The file was modifiedllvm/utils/lit/tests/max-failures.py
The file was removedllvm/utils/lit/tests/Inputs/shtest-shell/diff-error-0.txt
The file was modifiedllvm/utils/lit/lit/TestRunner.py
The file was modifiedllvm/utils/lit/tests/shtest-shell.py
Commit 7c1d536c21c7d98be350ffab8353e202c14dcc93 by dennyje
[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
The file was addedllvm/utils/lit/tests/Inputs/shtest-shell/diff-r-error-8.txt
The file was modifiedllvm/utils/lit/tests/shtest-shell.py
The file was modifiedllvm/utils/lit/lit/builtin_commands/diff.py
The file was addedllvm/utils/lit/tests/Inputs/shtest-shell/diff-r-error-7.txt
The file was modifiedllvm/utils/lit/tests/max-failures.py
The file was modifiedllvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes.txt
The file was modifiedllvm/utils/lit/tests/Inputs/shtest-shell/diff-encodings.txt