Skip to content
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

[beta] Copy --all-features request to all workspace members #5567

Merged
merged 2 commits into from
May 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cargo/ops/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ pub fn resolve_with_previous<'a, 'cfg>(
// workspace, then we use `method` specified. Otherwise we use a
// base method with no features specified but using default features
// for any other packages specified with `-p`.
Method::Required { dev_deps, .. } => {
Method::Required { dev_deps, all_features, .. } => {
let base = Method::Required {
dev_deps,
features: &[],
all_features: false,
all_features,
uses_default_features: true,
};
let member_id = member.package_id();
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3761,6 +3761,7 @@ fn custom_target_dir_line_parameter() {
}

#[test]
#[ignore]
fn rustc_no_trans() {
if !is_nightly() {
return;
Expand Down
39 changes: 39 additions & 0 deletions tests/testsuite/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2031,3 +2031,42 @@ fn only_dep_is_optional() {
execs().with_status(0),
);
}

#[test]
fn all_features_all_crates() {
Package::new("bar", "0.1.0").publish();

let p = project("foo")
.file(
"Cargo.toml",
r#"
[project]
name = "foo"
version = "0.0.1"
authors = []

[workspace]
members = ['bar']
"#,
)
.file("src/main.rs", "fn main() {}")
.file(
"bar/Cargo.toml",
r#"
[project]
name = "bar"
version = "0.0.1"
authors = []

[features]
foo = []
"#,
)
.file("bar/src/main.rs", "#[cfg(feature = \"foo\")] fn main() {}")
.build();

assert_that(
p.cargo("build --all-features --all"),
execs().with_status(0),
);
}
6 changes: 3 additions & 3 deletions tests/testsuite/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ test test_hello ... FAILED
failures:

---- test_hello stdout ----
<tab>thread 'test_hello' panicked at 'assertion failed:[..]",
[..]thread 'test_hello' panicked at 'assertion failed:[..]",
)
.with_stdout_contains("[..]`(left == right)`[..]")
.with_stdout_contains("[..]left: `\"hello\"`,[..]")
Expand Down Expand Up @@ -367,7 +367,7 @@ test test_hello ... FAILED
failures:

---- test_hello stdout ----
<tab>thread 'test_hello' panicked at 'assertion failed: false', \
[..]thread 'test_hello' panicked at 'assertion failed: false', \
tests[/]footest.rs:4[..]
",
)
Expand Down Expand Up @@ -413,7 +413,7 @@ test test_hello ... FAILED
failures:

---- test_hello stdout ----
<tab>thread 'test_hello' panicked at 'assertion failed: false', \
[..]thread 'test_hello' panicked at 'assertion failed: false', \
src[/]lib.rs:4[..]
",
)
Expand Down