mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Add test for cargo install
option --target-dir
This commit is contained in:
parent
35d3f6dcb0
commit
1f2de1e0a7
@ -308,6 +308,32 @@ fn install_path() {
|
|||||||
.run();
|
.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]
|
#[cargo_test]
|
||||||
fn multiple_crates_error() {
|
fn multiple_crates_error() {
|
||||||
let p = git::repo(&paths::root().join("foo"))
|
let p = git::repo(&paths::root().join("foo"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user