Skip to content

Commit

Permalink
Test: install bin with --path outside current workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Jan 27, 2022
1 parent 44f650f commit 76301eb
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,15 +530,28 @@ fn install_relative_path_outside_current_ws() {
.build();

p.cargo("install --path ../bar/foo")
.with_stderr(&format!(
"\
[INSTALLING] foo v0.0.1 ([..]/bar/foo)
[COMPILING] foo v0.0.1 ([..]/bar/foo)
[FINISHED] release [..]
[INSTALLING] {home}/bin/foo[EXE]
[INSTALLED] package `foo v0.0.1 ([..]/bar/foo)` (executable `foo[EXE]`)
[WARNING] be sure to add [..]
",
home = cargo_home().display(),
))
.run();

// Validate the workspace error message to display available targets.
p.cargo("install --path ../bar/foo --bin")
.with_status(101)
.with_stderr(
"\
[ERROR] current package believes it's in a workspace when it's not:
current: [CWD]/../bar/foo/Cargo.toml
workspace: [CWD]/Cargo.toml
[ERROR] \"--bin\" takes one argument.
Available binaries:
foo
this may be fixable by adding `../bar/foo` to the `workspace.members` [..]
Alternatively, [..]
",
)
.run();
Expand Down

0 comments on commit 76301eb

Please sign in to comment.