Skip to content
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

UI test output should be patch compatible #41948

Closed
nikomatsakis opened this issue May 12, 2017 · 1 comment
Closed

UI test output should be patch compatible #41948

nikomatsakis opened this issue May 12, 2017 · 1 comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@nikomatsakis
Copy link
Contributor

@eddyb made the good point that it'd be nice if the diff produced by UI tests were something one could easily feed into patch. Also, the role of - as "expected" and + as "actual" is correct, but the ordering is backwards from what diff uses. It'd be nice to change the call to diff so that instead of doing diff_lines(actual, expected) it did diff_lines(expected, actual) (and then making "left" print - etc).

(Another question, can we add unit tests here somehow?)

cc @cengizio

@nikomatsakis nikomatsakis added A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. labels May 12, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue May 23, 2017
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
@cengiz-io
Copy link
Contributor

This can be closed since #42144 has landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

2 participants