-
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
Add the known-bug
test directive, use it, and do some cleanup
#93953
Conversation
r=me with or without the nit applied, depending on how you feel about it. |
@bors r=Mark-Simulacrum |
📌 Commit 36cf48b has been approved by |
Add the `known-bug` test directive, use it, and do some cleanup cc rust-lang/compiler-team#476 Now tests can be annotated with `known-bug`, which should indicate that the test *should* pass (or at least that the current output is a bug). Adding it relaxes the requirement to add error annotations to the test (though it is still allowed). In the future, this could be extended with further relaxations - with the goal to make adding these tests need minimal effort. I've used this attribute for the GAT tests added in rust-lang#93757. Finally, I've also cleaned up `header.rs` in compiletest a bit, by extracting out a bit of common logic. I've also split out some of the directives into their own consts. This removes a lot of very similar functions from `Config` and makes `TestProps::load_from` read nicer. I've split these into separate commits, so I in theory could split these into separate PRs if they're controversial, but I think they're pretty straightforward. r? `@Mark-Simulacrum`
…askrgr Rollup of 10 pull requests Successful merges: - rust-lang#89892 (Suggest `impl Trait` return type when incorrectly using a generic return type) - rust-lang#91675 (Add MemTagSanitizer Support) - rust-lang#92806 (Add more information to `impl Trait` error) - rust-lang#93497 (Pass `--test` flag through rustdoc to rustc so `#[test]` functions can be scraped) - rust-lang#93814 (mips64-openwrt-linux-musl: correct soft-foat) - rust-lang#93847 (kmc-solid: Use the filesystem thread-safety wrapper) - rust-lang#93877 (asm: Allow the use of r8-r14 as clobbers on Thumb1) - rust-lang#93892 (Only mark projection as ambiguous if GAT substs are constrained) - rust-lang#93915 (Implement --check-cfg option (RFC 3013), take 2) - rust-lang#93953 (Add the `known-bug` test directive, use it, and do some cleanup) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
I didn't notice this PR soon enough, but this is a mistake, IMO. |
@petrochenkov there was some discussion on zulip about this, but let me try to summarize what I can recall: In regular tests, On the contrary, keeping the |
In practice this makes tests hard to read and write for me, so I'm currently just asking people to avoid |
In the linked issue I wanted to see where the bug is exactly, and what the bug is exactly, which is hard to do if the errors are in a different file and that file has lines anonymized, especially if the test gets larger than a few lines. |
cc rust-lang/compiler-team#476
Now tests can be annotated with
known-bug
, which should indicate that the test should pass (or at least that the current output is a bug). Adding it relaxes the requirement to add error annotations to the test (though it is still allowed). In the future, this could be extended with further relaxations - with the goal to make adding these tests need minimal effort.I've used this attribute for the GAT tests added in #93757.
Finally, I've also cleaned up
header.rs
in compiletest a bit, by extracting out a bit of common logic. I've also split out some of the directives into their own consts. This removes a lot of very similar functions fromConfig
and makesTestProps::load_from
read nicer.I've split these into separate commits, so I in theory could split these into separate PRs if they're controversial, but I think they're pretty straightforward.
r? @Mark-Simulacrum