-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Support multiple revisions in compiletest
#66524
Support multiple revisions in compiletest
#66524
Conversation
src/tools/compiletest/src/errors.rs
Outdated
match line[kind_start..] | ||
|
||
// Get the part of the comment after the sigil (e.g. `~^^` or ~|). | ||
let (_, mut msg) = line.split_at(captures.get(0).unwrap().end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BurntSushi Have you considered providing a method for the 0th-always-OK group to make things clearer and avoid the .unwrap()
in client code? Would have been helpful during review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't considered it, but it's not a bad idea! Thanks.
@bors r+ |
📌 Commit fd49547d03a0277818495f4028475d425abe4fe0 has been approved by |
☔ The latest upstream changes (presumably #66578) made this pull request unmergeable. Please resolve the merge conflicts. |
The `//[X]~` syntax filters errors for tests that are run across multiple cfgs with `// revisions:`. This commit extends that syntax to accept `//[X,Y]~`, which will match multiple cfgs to the same error annotation. This is functionally the same as writing two comments, `//[X]~` and `//[Y]~`, but can fit on a single line.
This test does not actually emit any warnings, since `#![allow(warnings)]` was specified. `compiletest` was erroneously ignoring `//~` tests and looking only for `//[X]~` ones. As a result of the changes in the previous commit, we now look for `//~` comments in incremental tests and expect them to appear in *all* revisions.
fd49547
to
ae22938
Compare
@bors r=Centril |
📌 Commit c537f22 has been approved by |
… r=Centril Support multiple revisions in `compiletest` The `//[X]~` syntax filters errors for tests that are run across multiple cfgs with `// revisions:`. This commit extends that syntax to accept `//[X,Y]~`, which will match multiple cfgs to the same error annotation. This is functionally the same as writing two comments, `//[X]~` and `//[Y]~`, but can fit on a single line. While refactoring `compiletest` to support this, I also uncovered a small bug that was causing an incremental test to always pass, despite no errors being emitted. r? @Centril
☀️ Test successful - checks-azure |
📣 Toolstate changed by #66524! Tested on commit bd816fd. 💔 rustc-guide on linux: test-pass → test-fail (cc @JohnTitor @amanjeev @spastorino @mark-i-m, @rust-lang/infra). |
Tested on commit rust-lang/rust@bd816fd. Direct link to PR: <rust-lang/rust#66524> 💔 rustc-guide on linux: test-pass → test-fail (cc @JohnTitor @amanjeev @spastorino @mark-i-m, @rust-lang/infra).
The
//[X]~
syntax filters errors for tests that are run across multiple cfgs with// revisions:
. This commit extends that syntax to accept//[X,Y]~
, which will match multiple cfgs to the same error annotation. This is functionally the same as writing two comments,//[X]~
and//[Y]~
, but can fit on a single line.While refactoring
compiletest
to support this, I also uncovered a small bug that was causing an incremental test to always pass, despite no errors being emitted.r? @Centril