-
Notifications
You must be signed in to change notification settings - Fork 190
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
CI: replace compiletest-rs with trybuild #268
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
use std::path::PathBuf; | ||
|
||
use compiletest_rs::{common::Mode, Config}; | ||
use trybuild::TestCases; | ||
|
||
#[test] | ||
fn ui() { | ||
let mut config = Config::default(); | ||
|
||
config.mode = Mode::Ui; | ||
config.src_base = PathBuf::from("ui/single"); | ||
config.target_rustcflags = Some( | ||
"--edition=2018 -L target/debug/deps -Z unstable-options --extern rtfm --extern lm3s6965" | ||
.to_owned(), | ||
); | ||
config.link_deps(); | ||
config.clean_rmeta(); | ||
|
||
compiletest_rs::run_tests(&config); | ||
let t = TestCases::new(); | ||
t.compile_fail("ui/single/*.rs"); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
warning: unused import: `rtfm::app` | ||
--> $DIR/task-priority-too-high.rs:3:5 | ||
| | ||
3 | use rtfm::app; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uh, spurious warning? Is this a known rustc bug? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The warning it's also present on 1.36.0. Perhaps this has been there for a while but compiletest ignores warnings by default? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's probably what's happening |
||
| ^^^^^^^^^ | ||
| | ||
= note: `#[warn(unused_imports)]` on by default | ||
|
||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/task-priority-too-high.rs:5:1 | ||
| | ||
5 | #[rtfm::app(device = lm3s6965)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to subtract with overflow | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0080`. |
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.
The compiler output might change between versions, so running this on all channels might cause issues later on
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.
good point. I have changed the condition to test only when
rustc --version == $MSRV
. $MSRV remains constant for a whole major version of rtfm (e.g. 1.36.0 for v0.5.x)