Add support for inputing via stdin with run-make-support by Urgau · Pull Request #124612 · rust-lang/rust (original) (raw)

This PR adds the facility to set a input bytes that will be passed via the standard input.

This is useful for testing rustc - (and soon rustdoc -).

In #124611 took the approach of having a dedicated run method but it is not very convenient to use and would necessitate many functions, one for success, one for fail, ...

Instead this PR takes a different approach and allows setting the input bytes as if it were a parameter and when calling the (now custom) output function, we write the input bytes into stdin. I think this gives us maximum flexibility in the implementation and a simple interface for users.

To test this new logic I ported tests/run-make/stdin-non-utf8/ to an rmake.rs one.

r? @jieyouxu