mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Test cases proving RUSTC_WRAPPER can be a relative path
This commit is contained in:
parent
b296129ab8
commit
8c268600d8
@ -3954,23 +3954,37 @@ fn run_proper_binary_main_rs_as_foo() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(windows))] // We don't have /usr/bin/env on Windows.
|
||||
fn rustc_wrapper() {
|
||||
// We don't have /usr/bin/env on Windows.
|
||||
if cfg!(windows) {
|
||||
return;
|
||||
}
|
||||
|
||||
let p = project()
|
||||
.file("Cargo.toml", &basic_bin_manifest("foo"))
|
||||
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
|
||||
.build();
|
||||
|
||||
let p = project().file("src/lib.rs", "").build();
|
||||
p.cargo("build -v")
|
||||
.env("RUSTC_WRAPPER", "/usr/bin/env")
|
||||
.with_stderr_contains("[RUNNING] `/usr/bin/env rustc --crate-name foo [..]")
|
||||
.run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(windows))]
|
||||
fn rustc_wrapper_relative() {
|
||||
let p = project().file("src/lib.rs", "").build();
|
||||
p.cargo("build -v")
|
||||
.env("RUSTC_WRAPPER", "./sccache")
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[..]/foo/./sccache rustc[..]")
|
||||
.run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(windows))]
|
||||
fn rustc_wrapper_from_path() {
|
||||
let p = project().file("src/lib.rs", "").build();
|
||||
p.cargo("build -v")
|
||||
.env("RUSTC_WRAPPER", "wannabe_sccache")
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[..]`wannabe_sccache rustc [..]")
|
||||
.run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cdylib_not_lifted() {
|
||||
let p = project()
|
||||
|
Loading…
x
Reference in New Issue
Block a user