mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
test: emit 1.77 syntax error only when msrv is incompatible
This commit is contained in:
parent
e91b58d252
commit
f70bfd3f4a
@ -5502,6 +5502,44 @@ for more information about build script outputs.
|
|||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cargo_test]
|
||||||
|
fn test_new_syntax_with_compatible_partial_msrv() {
|
||||||
|
let p = project()
|
||||||
|
.file(
|
||||||
|
"Cargo.toml",
|
||||||
|
r#"
|
||||||
|
[package]
|
||||||
|
name = "foo"
|
||||||
|
edition = "2015"
|
||||||
|
build = "build.rs"
|
||||||
|
rust-version = "1.77"
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
.file("src/lib.rs", "")
|
||||||
|
.file(
|
||||||
|
"build.rs",
|
||||||
|
r#"
|
||||||
|
fn main() {
|
||||||
|
println!("cargo::metadata=foo=bar");
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
p.cargo("check")
|
||||||
|
.with_status(101)
|
||||||
|
.with_stderr_contains(
|
||||||
|
"\
|
||||||
|
[COMPILING] foo [..]
|
||||||
|
[ERROR] the `cargo::` syntax for build script output instructions was added in Rust 1.77.0, \
|
||||||
|
but the minimum supported Rust version of `foo v0.0.0 ([ROOT]/foo)` is 1.77.
|
||||||
|
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script \
|
||||||
|
for more information about build script outputs.
|
||||||
|
",
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
#[cargo_test]
|
#[cargo_test]
|
||||||
fn test_old_syntax_with_old_msrv() {
|
fn test_old_syntax_with_old_msrv() {
|
||||||
let p = project()
|
let p = project()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user