Skip to content

Commit 400ba55

Browse files
committed
Fix build-std tests
1 parent 93da892 commit 400ba55

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

tests/build-std/main.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ fn basic() {
2828
.file(
2929
"Cargo.toml",
3030
r#"
31-
unstable-features = ["build-std"]
31+
cargo-features = ["build-std"]
3232
[package]
3333
name = "foo"
34-
version = "0.1.0"
34+
version = "0.0.1"
3535
edition = "2018"
3636
build-std = ["std"]
3737
"#,
@@ -78,21 +78,21 @@ fn basic() {
7878
)
7979
.build();
8080

81-
p.cargo("check").run();
81+
p.cargo("check").masquerade_as_nightly_cargo().run();
8282
p.cargo("build")
83+
.masquerade_as_nightly_cargo()
8384
// Importantly, this should not say [UPDATING]
8485
// There have been multiple bugs where every build triggers and update.
8586
.with_stderr(
8687
"[COMPILING] foo v0.0.1 [..]\n\
8788
[FINISHED] dev [..]",
8889
)
8990
.run();
90-
p.cargo("run").run();
91-
p.cargo("test").run();
91+
p.cargo("run").masquerade_as_nightly_cargo().run();
92+
p.cargo("test").masquerade_as_nightly_cargo().run();
9293

9394
// Check for hack that removes dylibs.
9495
let deps_dir = Path::new("target")
95-
.join(rustc_host())
9696
.join("debug")
9797
.join("deps");
9898
assert!(p.glob(deps_dir.join("*.rlib")).count() > 0);
@@ -105,7 +105,7 @@ fn cross_custom() {
105105
.file(
106106
"Cargo.toml",
107107
r#"
108-
unstable-features = ["build-std"]
108+
cargo-features = ["build-std"]
109109
[package]
110110
name = "foo"
111111
version = "0.1.0"
@@ -139,7 +139,9 @@ fn cross_custom() {
139139
)
140140
.build();
141141

142-
p.cargo("build --target custom-target.json -v").run();
142+
p.cargo("build --target custom-target.json -v")
143+
.masquerade_as_nightly_cargo()
144+
.run();
143145
}
144146

145147
#[cargo_test(build_std)]
@@ -148,7 +150,7 @@ fn custom_test_framework() {
148150
.file(
149151
"Cargo.toml",
150152
r#"
151-
unstable-features = ["build-std"]
153+
cargo-features = ["build-std"]
152154
[package]
153155
name = "foo"
154156
version = "0.1.0"
@@ -206,6 +208,7 @@ fn custom_test_framework() {
206208
let new_path = env::join_paths(paths).unwrap();
207209

208210
p.cargo("test --target target.json --no-run -v")
211+
.masquerade_as_nightly_cargo()
209212
.env("PATH", new_path)
210213
.run();
211214
}

0 commit comments

Comments
 (0)