-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Currently, when a UI test fails, it prints a sort of overwhelming amount of stuff:
rust/src/tools/compiletest/src/runtest.rs
Lines 2712 to 2722 in a3c3245
println!("normalized {}:\n{}\n", kind, actual); | |
println!("expected {}:\n{}\n", kind, expected); | |
println!("diff of {}:\n", kind); | |
for diff in diff::lines(expected, actual) { | |
match diff { | |
diff::Result::Left(l) => println!("-{}", l), | |
diff::Result::Both(l, _) => println!(" {}", l), | |
diff::Result::Right(r) => println!("+{}", r), | |
} | |
} |
I think what I would like is something like:
If the expected text is empty, just dump the actual (normalized) output, so people can copy-and-paste it if they want.
Else, just print the diff. And probably it'd be nice to strip off the "prefix" and "suffix" of unchanged lines, and just show the parts that vary (we could imagine breaking things into hunks).
Metadata
Metadata
Assignees
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.