-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make ui test output patch compatible #41948 #42144
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
Niko, could you take a look at @cengizio's questions about unit tests? |
Yeah, I'm not sure what's the best way to handle unit-testing. The most "robust" would be to somehow "execute" the runtest tool and capture the output, but perhaps it'd be easier to just isolate the routines in question and have them read from simulated data structures, writing to a |
@bors r+ rollup |
📌 Commit 9111d07 has been approved by |
make ui test output patch compatible rust-lang#41948 Hello! Previously with rust-lang#41474 I've changed the internals of UI test output comparison mechanism. That change didn't change the diff format that we were producing but we needed to improve it anyway. This makes unified diff lines a little bit more `patch` compatible. Also I tried to introduce a unit test to check this but couldn't decide which of the following to implement: 1. Should I replace `println` macros with `Writer`s? And access the produced output within a test? 2. Should I add an external test (something like `src/test/run-pass/command-exec.rs`) 3. There are crates that capture `stdout`. Are they safe to use here? (I don't think so) Thanks! cc @nikomatsakis
Hello!
Previously with #41474 I've changed the internals of UI test output comparison mechanism.
That change didn't change the diff format that we were producing but we needed to improve it anyway.
This makes unified diff lines a little bit more
patch
compatible.Also I tried to introduce a unit test to check this but couldn't decide which of the following to implement:
println
macros withWriter
s? And access the produced output within a test?src/test/run-pass/command-exec.rs
)stdout
. Are they safe to use here? (I don't think so)Thanks!
cc @nikomatsakis