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 tests fail with useless diff when reference file has CR LF line endings #47101

Open
hanna-kruppe opened this issue Jan 1, 2018 · 3 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@hanna-kruppe
Copy link
Contributor

I created a UI test on a windows machine. It failed with this message:

---- [ui] ui\issue-47094.rs stdout ----
        normalized stderr:
warning[E0566]: conflicting representation hints
  --> $DIR/issue-47094.rs:13:8
   |
13 | #[repr(C,u8)]
   |        ^ ^^

warning[E0566]: conflicting representation hints
  --> $DIR/issue-47094.rs:19:8
   |
19 | #[repr(C)]
   |        ^
20 | #[repr(u8)]
   |        ^^



expected stderr:
warning[E0566]: conflicting representation hints
  --> $DIR/issue-47094.rs:13:8
   |
13 | #[repr(C,u8)]
   |        ^ ^^

warning[E0566]: conflicting representation hints
  --> $DIR/issue-47094.rs:19:8
   |
19 | #[repr(C)]
   |        ^
20 | #[repr(u8)]
   |        ^^



diff of stderr:

 warning[E0566]: conflicting representation hints
   --> $DIR/issue-47094.rs:13:8
    |
 13 | #[repr(C,u8)]
    |        ^ ^^

 warning[E0566]: conflicting representation hints
   --> $DIR/issue-47094.rs:19:8
    |
 19 | #[repr(C)]
    |        ^
 20 | #[repr(u8)]
    |        ^^



The actual stderr differed from the expected stderr

Changing the line endings to LF in my editor fixed it.

@hanna-kruppe hanna-kruppe changed the title UI tests fail but produce a useless diff when reference file has CR LF line endings UI tests fail with useless diff when reference file has CR LF line endings Jan 1, 2018
@hanna-kruppe
Copy link
Contributor Author

Note: this would not be an issue if update-{all-,}references.sh were, well, not a shell script. Alas, it's not and so I am reduced to copying the expected stderr from the test failure. Admittedly, copying the build/.../*.stderr file (as the script does) would also avoid this error, but that's not easier than copying from the console output.

@nikomatsakis nikomatsakis added the A-testsuite Area: The testsuite used to check the correctness of rustc label Jan 3, 2018
@nikomatsakis
Copy link
Contributor

I've been wanting to rewrite the update-references.sh setup into something that is in pure Rust (or at least generally improve that workflow).

@XAMPPRocky XAMPPRocky added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Apr 10, 2018
@Enselic
Copy link
Member

Enselic commented Oct 4, 2023

Triage: Is this still a problem? There has been several CR LF fixes over the years. If this is still a problem, would you mind sharing the problematic test code please?

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-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants