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.
This function seems fragile to me. It reads each file three times:
I think the best way to be portable between Python 2 & 3 will probably be to work in bytes as much as possible.
I think you can use this pattern to get a new file descriptor for stdin that reads bytes:
Here's how I would do it:
Does that seem reasonable?