Skip to content

Commit

Permalink
Test cases proving RUSTC_WRAPPER can be a relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Feb 14, 2019
1 parent b296129 commit 8c26860
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 8c26860

Please sign in to comment.