Skip to content

Commit 1f2de1e

Browse files
committed
Add test for cargo install option --target-dir
1 parent 35d3f6d commit 1f2de1e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/testsuite/install.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,32 @@ fn install_path() {
308308
.run();
309309
}
310310

311+
#[cargo_test]
312+
fn install_target_dir() {
313+
let p = project().file("src/main.rs", "fn main() {}").build();
314+
315+
p.cargo("install --target-dir td_test")
316+
.with_stderr(
317+
"\
318+
[WARNING] Using `cargo install` [..]
319+
[INSTALLING] foo v0.0.1 [..]
320+
[COMPILING] foo v0.0.1 [..]
321+
[FINISHED] release [..]
322+
[INSTALLING] [..]foo
323+
[INSTALLED] package `foo v0.0.1 [..]foo[..]` (executable `foo[EXE]`)
324+
[WARNING] be sure to add [..]
325+
",
326+
)
327+
.run();
328+
329+
let mut path = p.root();
330+
path.push("td_test");
331+
assert!(path.exists());
332+
333+
path.push("release/foo");
334+
assert!(path.exists());
335+
}
336+
311337
#[cargo_test]
312338
fn multiple_crates_error() {
313339
let p = git::repo(&paths::root().join("foo"))

0 commit comments

Comments
 (0)