1. [lit] Make internal diff work in pipelines (details)
  2. [lit] Clean up internal diff's encoding handling (details)
Commit df35ec8289eec85e9a551578b1b7ae35b214860f by jdenny.ornl
[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
# 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.
Reviewed By: probinson, stella.stamenova
Differential Revision:
llvm-svn: 374388
The file was modifiedllvm/utils/lit/lit/
The file was addedllvm/utils/lit/lit/builtin_commands/
The file was addedllvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes.txt
The file was removedllvm/utils/lit/tests/Inputs/shtest-shell/diff-error-0.txt
The file was modifiedllvm/utils/lit/tests/
Commit 19e6bb25f05fa24ea445dd455c7f44fc3b036725 by jdenny.ornl
[lit] Clean up internal diff's encoding handling
As suggested by rnk at D67643#1673043, instead of reading files multiple
times until an appropriate encoding is found, read them once as binary,
and then try to decode what was read.
For python >= 3.5, don't fail when attempting to decode the
`diff_bytes` output in order to print it.
Finally, add some tests for encoding handling.
Reviewed By: rnk
Differential Revision:
llvm-svn: 374389
The file was modifiedllvm/utils/lit/tests/
The file was addedllvm/utils/lit/tests/Inputs/shtest-shell/diff-in.utf16
The file was modifiedllvm/utils/lit/tests/
The file was modifiedllvm/utils/lit/lit/builtin_commands/
The file was addedllvm/utils/lit/tests/Inputs/shtest-shell/diff-in.utf8
The file was addedllvm/utils/lit/tests/Inputs/shtest-shell/diff-in.bin
The file was addedllvm/utils/lit/tests/Inputs/shtest-shell/diff-encodings.txt