-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rebased and fixed 4025: Apply --all if workspace is virtual #4335
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
193a95a
Apply --all if workspace is virtual
rsertelon 15791c7
Adds tests
rsertelon 33431d7
Proper building virtual manifest with -p flag
debris 7d842fe
Fixed bench_virtual_manifest_all_implied test
debris 1476448
Fixed test_virtual_manifest_all_implied test
debris f1f3b15
Updated build_virtual_manifest_one_project test
debris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ src/registry/Cargo.lock | |
rustc | ||
__pycache__ | ||
.idea/ | ||
*.iml | ||
*.iml | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3038,6 +3038,74 @@ fn build_all_virtual_manifest() { | |
[..] Finished dev [unoptimized + debuginfo] target(s) in [..]\n")); | ||
} | ||
|
||
#[test] | ||
fn build_virtual_manifest_all_implied() { | ||
let p = project("workspace") | ||
.file("Cargo.toml", r#" | ||
[workspace] | ||
members = ["foo", "bar"] | ||
"#) | ||
.file("foo/Cargo.toml", r#" | ||
[project] | ||
name = "foo" | ||
version = "0.1.0" | ||
"#) | ||
.file("foo/src/lib.rs", r#" | ||
pub fn foo() {} | ||
"#) | ||
.file("bar/Cargo.toml", r#" | ||
[project] | ||
name = "bar" | ||
version = "0.1.0" | ||
"#) | ||
.file("bar/src/lib.rs", r#" | ||
pub fn bar() {} | ||
"#); | ||
|
||
// The order in which foo and bar are built is not guaranteed | ||
assert_that(p.cargo_process("build"), | ||
execs().with_status(0) | ||
.with_stderr_contains("[..] Compiling bar v0.1.0 ([..])") | ||
.with_stderr_contains("[..] Compiling foo v0.1.0 ([..])") | ||
.with_stderr("[..] Compiling [..] v0.1.0 ([..])\n\ | ||
[..] Compiling [..] v0.1.0 ([..])\n\ | ||
[..] Finished dev [unoptimized + debuginfo] target(s) in [..]\n")); | ||
} | ||
|
||
#[test] | ||
fn build_virtual_manifest_one_project() { | ||
let p = project("workspace") | ||
.file("Cargo.toml", r#" | ||
[workspace] | ||
members = ["foo", "bar"] | ||
"#) | ||
.file("foo/Cargo.toml", r#" | ||
[project] | ||
name = "foo" | ||
version = "0.1.0" | ||
"#) | ||
.file("foo/src/lib.rs", r#" | ||
pub fn foo() {} | ||
"#) | ||
.file("bar/Cargo.toml", r#" | ||
[project] | ||
name = "bar" | ||
version = "0.1.0" | ||
"#) | ||
.file("bar/src/lib.rs", r#" | ||
pub fn bar() {} | ||
"#); | ||
|
||
// The order in which foo and bar are built is not guaranteed | ||
assert_that(p.cargo_process("build") | ||
.arg("-p").arg("foo"), | ||
execs().with_status(0) | ||
.with_stderr_does_not_contain("[..] Compiling bar v0.1.0 ([..])") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's change this to |
||
.with_stderr_contains("[..] Compiling foo v0.1.0 ([..])") | ||
.with_stderr("[..] Compiling [..] v0.1.0 ([..])\n\ | ||
[..] Finished dev [unoptimized + debuginfo] target(s) in [..]\n")); | ||
} | ||
|
||
#[test] | ||
fn build_all_virtual_manifest_implicit_examples() { | ||
let p = project("foo") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is a bit misleading, because we don' compile
bar
at all :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed