mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Improve precision of host build.rustflags tests
This commit is contained in:
parent
b4ce8a8ed2
commit
54674d365b
@ -731,26 +731,6 @@ fn build_rustflags_normal_source_with_target() {
|
|||||||
.with_status(101)
|
.with_status(101)
|
||||||
.with_stderr_contains("[..]bogus[..]")
|
.with_stderr_contains("[..]bogus[..]")
|
||||||
.run();
|
.run();
|
||||||
|
|
||||||
// With -Ztarget-applies-to-host build.rustflags should still not apply to build.rs, even when
|
|
||||||
// target == host, to match legacy Cargo behavior.
|
|
||||||
p.change_file("build.rs", "fn main() {}");
|
|
||||||
p.change_file(
|
|
||||||
".cargo/config",
|
|
||||||
r#"
|
|
||||||
target-applies-to-host = true
|
|
||||||
|
|
||||||
[build]
|
|
||||||
rustflags = ["-Z", "bogus"]
|
|
||||||
"#,
|
|
||||||
);
|
|
||||||
p.cargo("build --lib --target")
|
|
||||||
.arg(host)
|
|
||||||
.masquerade_as_nightly_cargo()
|
|
||||||
.arg("-Ztarget-applies-to-host")
|
|
||||||
.with_status(101)
|
|
||||||
.with_stderr_does_not_contain("[..]build_script_build[..]")
|
|
||||||
.run();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cargo_test]
|
#[cargo_test]
|
||||||
@ -1161,7 +1141,7 @@ fn build_rustflags_for_build_scripts() {
|
|||||||
// With "legacy" behavior, build.rustflags should apply to build scripts without --target
|
// With "legacy" behavior, build.rustflags should apply to build scripts without --target
|
||||||
p.cargo("build")
|
p.cargo("build")
|
||||||
.with_status(101)
|
.with_status(101)
|
||||||
.with_stderr_does_not_contain("[..]build_script_build[..]")
|
.with_stderr_contains("[..]previous definition of the value `main` here[..]")
|
||||||
.run();
|
.run();
|
||||||
|
|
||||||
// But should _not_ apply _with_ --target
|
// But should _not_ apply _with_ --target
|
||||||
@ -1172,7 +1152,7 @@ fn build_rustflags_for_build_scripts() {
|
|||||||
.masquerade_as_nightly_cargo()
|
.masquerade_as_nightly_cargo()
|
||||||
.arg("-Ztarget-applies-to-host")
|
.arg("-Ztarget-applies-to-host")
|
||||||
.with_status(101)
|
.with_status(101)
|
||||||
.with_stderr_does_not_contain("[..]build_script_build[..]")
|
.with_stderr_contains("[..]previous definition of the value `main` here[..]")
|
||||||
.run();
|
.run();
|
||||||
p.cargo("build --target")
|
p.cargo("build --target")
|
||||||
.arg(host)
|
.arg(host)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user