Skip to content

Commit

Permalink
Auto merge of #3385 - matklad:package-test, r=alexcrichton
Browse files Browse the repository at this point in the history
Add test for --package and virtual manifest

closes #3194

The issue was actually fixed by #3221 (thanks @euclio !), so let's just add a test (a copy of `virtual_works` basically).
  • Loading branch information
bors committed Dec 13, 2016
2 parents a0f6557 + 23faf5c commit 020df94
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,28 @@ fn virtual_works() {
assert_that(&p.root().join("bar/Cargo.lock"), is_not(existing_file()));
}

#[test]
fn explicit_package_argument_works_with_virtual_manifest() {
let p = project("foo")
.file("Cargo.toml", r#"
[workspace]
members = ["bar"]
"#)
.file("bar/Cargo.toml", r#"
[project]
name = "bar"
version = "0.1.0"
authors = []
"#)
.file("bar/src/main.rs", "fn main() {}");
p.build();
assert_that(p.cargo("build").cwd(p.root()).args(&["--package", "bar"]),
execs().with_status(0));
assert_that(&p.root().join("Cargo.lock"), existing_file());
assert_that(&p.bin("bar"), existing_file());
assert_that(&p.root().join("bar/Cargo.lock"), is_not(existing_file()));
}

#[test]
fn virtual_misconfigure() {
let p = project("foo")
Expand Down

0 comments on commit 020df94

Please sign in to comment.