Skip to content

Commit 8012d32

Browse files
author
Jon Gjengset
committed
Avoid coercing path to string for windows
1 parent 719eb59 commit 8012d32

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

tests/testsuite/build_script.rs

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -183,33 +183,26 @@ fn custom_build_env_var_rustflags() {
183183
fn custom_build_env_var_rustc_wrapper() {
184184
let wrapper = tools::echo_wrapper();
185185
let p = project()
186-
.file(
187-
".cargo/config",
188-
&format!(
189-
r#"
190-
[build]
191-
rustc-wrapper = "{}"
192-
"#,
193-
wrapper.display()
194-
),
195-
)
196186
.file(
197187
"build.rs",
198-
&format!(
199-
r#"
200-
use std::env;
188+
r#"
189+
use std::env;
201190
202-
fn main() {{
203-
assert!(env::var("CARGO_RUSTC_WRAPPER").unwrap().ends_with("{}"));
204-
}}
205-
"#,
206-
wrapper.display()
207-
),
191+
fn main() {{
192+
assert_eq!(
193+
env::var("CARGO_RUSTC_WRAPPER").unwrap(),
194+
env::var("CARGO_RUSTC_WRAPPER_CHECK").unwrap()
195+
);
196+
}}
197+
"#,
208198
)
209199
.file("src/lib.rs", "")
210200
.build();
211201

212-
p.cargo("check").run();
202+
p.cargo("check")
203+
.env("CARGO_BUILD_RUSTC_WRAPPER", &wrapper)
204+
.env("CARGO_RUSTC_WRAPPER_CHECK", &wrapper)
205+
.run();
213206
}
214207

215208
#[cargo_test]

0 commit comments

Comments
 (0)