Add test for cargo install option --target-dir

This commit is contained in:
bl2e 2020-06-20 17:13:10 -07:00
parent 35d3f6dcb0
commit 1f2de1e0a7

View File

@ -308,6 +308,32 @@ fn install_path() {
.run();
}
#[cargo_test]
fn install_target_dir() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("install --target-dir td_test")
.with_stderr(
"\
[WARNING] Using `cargo install` [..]
[INSTALLING] foo v0.0.1 [..]
[COMPILING] foo v0.0.1 [..]
[FINISHED] release [..]
[INSTALLING] [..]foo
[INSTALLED] package `foo v0.0.1 [..]foo[..]` (executable `foo[EXE]`)
[WARNING] be sure to add [..]
",
)
.run();
let mut path = p.root();
path.push("td_test");
assert!(path.exists());
path.push("release/foo");
assert!(path.exists());
}
#[cargo_test]
fn multiple_crates_error() {
let p = git::repo(&paths::root().join("foo"))