From 1f8b398802d6bb78d7d8d32415967b85662cd3c8 Mon Sep 17 00:00:00 2001 From: Daniel Albert Date: Wed, 31 Aug 2016 19:03:26 +0200 Subject: [PATCH] Add --all-features flag to cargo --- src/bin/bench.rs | 3 ++ src/bin/build.rs | 3 ++ src/bin/doc.rs | 3 ++ src/bin/install.rs | 5 ++- src/bin/metadata.rs | 3 ++ src/bin/run.rs | 3 ++ src/bin/rustc.rs | 3 ++ src/bin/rustdoc.rs | 3 ++ src/bin/test.rs | 3 ++ src/cargo/core/package.rs | 2 +- src/cargo/ops/cargo_compile.rs | 20 ++++++++---- src/cargo/ops/cargo_output_metadata.rs | 2 ++ src/cargo/ops/cargo_package.rs | 1 + src/etc/_cargo | 9 ++++++ src/etc/cargo.bashcomp.sh | 2 +- src/etc/man/cargo-bench.1 | 5 +++ src/etc/man/cargo-build.1 | 5 +++ src/etc/man/cargo-doc.1 | 5 +++ src/etc/man/cargo-install.1 | 5 +++ src/etc/man/cargo-metadata.1 | 5 +++ src/etc/man/cargo-run.1 | 5 +++ src/etc/man/cargo-rustc.1 | 5 +++ src/etc/man/cargo-rustdoc.1 | 5 +++ src/etc/man/cargo-test.1 | 5 +++ tests/features.rs | 44 ++++++++++++++++++++++++++ 25 files changed, 145 insertions(+), 9 deletions(-) diff --git a/src/bin/bench.rs b/src/bin/bench.rs index c7cf6b69332..f2d028d34e4 100644 --- a/src/bin/bench.rs +++ b/src/bin/bench.rs @@ -9,6 +9,7 @@ pub struct Options { flag_package: Vec, flag_jobs: Option, flag_features: Vec, + flag_all_features: bool, flag_no_default_features: bool, flag_target: Option, flag_manifest_path: Option, @@ -42,6 +43,7 @@ Options: -p SPEC, --package SPEC ... Package to run benchmarks for -j N, --jobs N Number of parallel jobs, defaults to # of CPUs --features FEATURES Space-separated list of features to also build + --all-features Build all available features --no-default-features Do not build the `default` feature --target TRIPLE Build for the target triple --manifest-path PATH Path to the manifest to build benchmarks for @@ -83,6 +85,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { jobs: options.flag_jobs, target: options.flag_target.as_ref().map(|s| &s[..]), features: &options.flag_features, + all_features: options.flag_all_features, no_default_features: options.flag_no_default_features, spec: &options.flag_package, exec_engine: None, diff --git a/src/bin/build.rs b/src/bin/build.rs index 601344adf7c..2f23ce1be3b 100644 --- a/src/bin/build.rs +++ b/src/bin/build.rs @@ -11,6 +11,7 @@ pub struct Options { flag_package: Vec, flag_jobs: Option, flag_features: Vec, + flag_all_features: bool, flag_no_default_features: bool, flag_target: Option, flag_manifest_path: Option, @@ -44,6 +45,7 @@ Options: --bench NAME Build only the specified benchmark target --release Build artifacts in release mode, with optimizations --features FEATURES Space-separated list of features to also build + --all-features Build all available features --no-default-features Do not build the `default` feature --target TRIPLE Build for the target triple --manifest-path PATH Path to the manifest to compile @@ -79,6 +81,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { jobs: options.flag_jobs, target: options.flag_target.as_ref().map(|t| &t[..]), features: &options.flag_features, + all_features: options.flag_all_features, no_default_features: options.flag_no_default_features, spec: &options.flag_package, exec_engine: None, diff --git a/src/bin/doc.rs b/src/bin/doc.rs index 7f4fc2878e5..c4139987cf7 100644 --- a/src/bin/doc.rs +++ b/src/bin/doc.rs @@ -7,6 +7,7 @@ use cargo::util::important_paths::{find_root_manifest_for_wd}; pub struct Options { flag_target: Option, flag_features: Vec, + flag_all_features: bool, flag_jobs: Option, flag_manifest_path: Option, flag_no_default_features: bool, @@ -39,6 +40,7 @@ Options: --bin NAME Document only the specified binary --release Build artifacts in release mode, with optimizations --features FEATURES Space-separated list of features to also build + --all-features Build all available features --no-default-features Do not build the `default` feature --target TRIPLE Build for the target triple --manifest-path PATH Path to the manifest to document @@ -74,6 +76,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { jobs: options.flag_jobs, target: options.flag_target.as_ref().map(|t| &t[..]), features: &options.flag_features, + all_features: options.flag_all_features, no_default_features: options.flag_no_default_features, spec: &options.flag_package, exec_engine: None, diff --git a/src/bin/install.rs b/src/bin/install.rs index 2a58688021d..544b115e9a2 100644 --- a/src/bin/install.rs +++ b/src/bin/install.rs @@ -6,6 +6,7 @@ use cargo::util::{CliResult, Config, ToUrl}; pub struct Options { flag_jobs: Option, flag_features: Vec, + flag_all_features: bool, flag_no_default_features: bool, flag_debug: bool, flag_bin: Vec, @@ -48,8 +49,9 @@ Specifying what crate to install: Build and install options: -h, --help Print this message -j N, --jobs N Number of parallel jobs, defaults to # of CPUs - --features FEATURES Space-separated list of features to activate -f, --force Force overwriting existing crates or binaries + --features FEATURES Space-separated list of features to activate + --all-features Build all available features --no-default-features Do not build the `default` feature --debug Build in debug mode instead of release mode --bin NAME Only install the binary NAME @@ -104,6 +106,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { jobs: options.flag_jobs, target: None, features: &options.flag_features, + all_features: options.flag_all_features, no_default_features: options.flag_no_default_features, spec: &[], exec_engine: None, diff --git a/src/bin/metadata.rs b/src/bin/metadata.rs index d5c2d09056e..4553711045b 100644 --- a/src/bin/metadata.rs +++ b/src/bin/metadata.rs @@ -7,6 +7,7 @@ use cargo::util::{CliResult, Config}; pub struct Options { flag_color: Option, flag_features: Vec, + flag_all_features: bool, flag_format_version: u32, flag_manifest_path: Option, flag_no_default_features: bool, @@ -27,6 +28,7 @@ Usage: Options: -h, --help Print this message --features FEATURES Space-separated list of features + --all-features Build all available features --no-default-features Do not include the `default` feature --no-deps Output information only about the root package and don't fetch dependencies. @@ -50,6 +52,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult, flag_jobs: Option, flag_features: Vec, + flag_all_features: bool, flag_no_default_features: bool, flag_target: Option, flag_manifest_path: Option, @@ -34,6 +35,7 @@ Options: -j N, --jobs N Number of parallel jobs, defaults to # of CPUs --release Build artifacts in release mode, with optimizations --features FEATURES Space-separated list of features to also build + --all-features Build all available features --no-default-features Do not build the `default` feature --target TRIPLE Build for the target triple --manifest-path PATH Path to the manifest to execute @@ -75,6 +77,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { jobs: options.flag_jobs, target: options.flag_target.as_ref().map(|t| &t[..]), features: &options.flag_features, + all_features: options.flag_all_features, no_default_features: options.flag_no_default_features, spec: &[], exec_engine: None, diff --git a/src/bin/rustc.rs b/src/bin/rustc.rs index 10fd9fc9130..e81c8d18f7a 100644 --- a/src/bin/rustc.rs +++ b/src/bin/rustc.rs @@ -12,6 +12,7 @@ pub struct Options { flag_package: Option, flag_jobs: Option, flag_features: Vec, + flag_all_features: bool, flag_no_default_features: bool, flag_target: Option, flag_manifest_path: Option, @@ -47,6 +48,7 @@ Options: --release Build artifacts in release mode, with optimizations --profile PROFILE Profile to build the selected target for --features FEATURES Features to compile for the package + --all-features Build all available features --no-default-features Do not compile default features for the package --target TRIPLE Target triple which compiles will be for --manifest-path PATH Path to the manifest to fetch dependencies for @@ -97,6 +99,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { jobs: options.flag_jobs, target: options.flag_target.as_ref().map(|t| &t[..]), features: &options.flag_features, + all_features: options.flag_all_features, no_default_features: options.flag_no_default_features, spec: &options.flag_package.map_or(Vec::new(), |s| vec![s]), exec_engine: None, diff --git a/src/bin/rustdoc.rs b/src/bin/rustdoc.rs index 010b003c58d..15e4a91ca66 100644 --- a/src/bin/rustdoc.rs +++ b/src/bin/rustdoc.rs @@ -8,6 +8,7 @@ pub struct Options { arg_opts: Vec, flag_target: Option, flag_features: Vec, + flag_all_features: bool, flag_jobs: Option, flag_manifest_path: Option, flag_no_default_features: bool, @@ -44,6 +45,7 @@ Options: --bench NAME Build only the specified benchmark target --release Build artifacts in release mode, with optimizations --features FEATURES Space-separated list of features to also build + --all-features Build all available features --no-default-features Do not build the `default` feature --target TRIPLE Build for the target triple --manifest-path PATH Path to the manifest to document @@ -83,6 +85,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { jobs: options.flag_jobs, target: options.flag_target.as_ref().map(|t| &t[..]), features: &options.flag_features, + all_features: options.flag_all_features, no_default_features: options.flag_no_default_features, spec: &options.flag_package.map_or(Vec::new(), |s| vec![s]), exec_engine: None, diff --git a/src/bin/test.rs b/src/bin/test.rs index cd823a59172..c5e687a6483 100644 --- a/src/bin/test.rs +++ b/src/bin/test.rs @@ -7,6 +7,7 @@ use cargo::util::important_paths::{find_root_manifest_for_wd}; pub struct Options { arg_args: Vec, flag_features: Vec, + flag_all_features: bool, flag_jobs: Option, flag_manifest_path: Option, flag_no_default_features: bool, @@ -47,6 +48,7 @@ Options: -j N, --jobs N Number of parallel jobs, defaults to # of CPUs --release Build artifacts in release mode, with optimizations --features FEATURES Space-separated list of features to also build + --all-features Build all available features --no-default-features Do not build the `default` feature --target TRIPLE Build for the target triple --manifest-path PATH Path to the manifest to build tests for @@ -115,6 +117,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { jobs: options.flag_jobs, target: options.flag_target.as_ref().map(|s| &s[..]), features: &options.flag_features, + all_features: options.flag_all_features, no_default_features: options.flag_no_default_features, spec: &options.flag_package, exec_engine: None, diff --git a/src/cargo/core/package.rs b/src/cargo/core/package.rs index ffd5c93640a..c0554fbfc55 100644 --- a/src/cargo/core/package.rs +++ b/src/cargo/core/package.rs @@ -78,7 +78,7 @@ impl Package { pub fn package_id(&self) -> &PackageId { self.manifest.package_id() } pub fn root(&self) -> &Path { self.manifest_path.parent().unwrap() } pub fn summary(&self) -> &Summary { self.manifest.summary() } - pub fn targets(&self) -> &[Target] { self.manifest().targets() } + pub fn targets(&self) -> &[Target] { self.manifest.targets() } pub fn version(&self) -> &Version { self.package_id().version() } pub fn authors(&self) -> &Vec { &self.manifest.metadata().authors } pub fn publish(&self) -> bool { self.manifest.publish() } diff --git a/src/cargo/ops/cargo_compile.rs b/src/cargo/ops/cargo_compile.rs index 09643591b2a..25b96891787 100644 --- a/src/cargo/ops/cargo_compile.rs +++ b/src/cargo/ops/cargo_compile.rs @@ -44,6 +44,8 @@ pub struct CompileOptions<'a> { pub target: Option<&'a str>, /// Extra features to build for the root package pub features: &'a [String], + /// Flag whether all available features should be built for the root package + pub all_features: bool, /// Flag if the default feature should be built for the root package pub no_default_features: bool, /// Root package to build (if None it's the current one) @@ -94,6 +96,7 @@ pub fn compile<'a>(ws: &Workspace<'a>, options: &CompileOptions<'a>) pub fn resolve_dependencies<'a>(ws: &Workspace<'a>, source: Option>, features: Vec, + all_features: bool, no_default_features: bool) -> CargoResult<(PackageSet<'a>, Resolve)> { @@ -115,10 +118,14 @@ pub fn resolve_dependencies<'a>(ws: &Workspace<'a>, try!(add_overrides(&mut registry, ws)); - let method = Method::Required{ - dev_deps: true, // TODO: remove this option? - features: &features, - uses_default_features: !no_default_features, + let method = if all_features { + Method::Everything + } else { + Method::Required { + dev_deps: true, // TODO: remove this option? + features: &features, + uses_default_features: !no_default_features, + } }; let resolved_with_overrides = @@ -137,7 +144,8 @@ pub fn compile_ws<'a>(ws: &Workspace<'a>, -> CargoResult> { let root_package = try!(ws.current()); let CompileOptions { config, jobs, target, spec, features, - no_default_features, release, mode, + all_features, no_default_features, + release, mode, ref filter, ref exec_engine, ref target_rustdoc_args, ref target_rustc_args } = *options; @@ -157,7 +165,7 @@ pub fn compile_ws<'a>(ws: &Workspace<'a>, } let (packages, resolve_with_overrides) = { - try!(resolve_dependencies(ws, source, features, no_default_features)) + try!(resolve_dependencies(ws, source, features, all_features, no_default_features)) }; let mut pkgids = Vec::new(); diff --git a/src/cargo/ops/cargo_output_metadata.rs b/src/cargo/ops/cargo_output_metadata.rs index 5178dbc8eec..035c7350fe9 100644 --- a/src/cargo/ops/cargo_output_metadata.rs +++ b/src/cargo/ops/cargo_output_metadata.rs @@ -10,6 +10,7 @@ const VERSION: u32 = 1; pub struct OutputMetadataOptions { pub features: Vec, pub no_default_features: bool, + pub all_features: bool, pub no_deps: bool, pub version: u32, } @@ -45,6 +46,7 @@ fn metadata_full(ws: &Workspace, let deps = try!(ops::resolve_dependencies(ws, None, opt.features.clone(), + opt.all_features, opt.no_default_features)); let (packages, resolve) = deps; diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index e6a89e331b0..3a6f51d5f13 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -275,6 +275,7 @@ fn run_verify(ws: &Workspace, tar: &File, opts: &PackageOpts) -> CargoResult<()> target: None, features: &[], no_default_features: false, + all_features: false, spec: &[], filter: ops::CompileFilter::Everything, exec_engine: None, diff --git a/src/etc/_cargo b/src/etc/_cargo index 9a883dd2509..17585920252 100644 --- a/src/etc/_cargo +++ b/src/etc/_cargo @@ -20,6 +20,7 @@ case $state in bench) _arguments \ '--features=[space separated feature list]' \ + '--all-features[enable all available features]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ "${command_scope_spec[@]}" \ @@ -36,6 +37,7 @@ case $state in build) _arguments \ '--features=[space separated feature list]' \ + '--all-features[enable all available features]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ "${command_scope_spec[@]}" \ @@ -64,6 +66,7 @@ case $state in doc) _arguments \ '--features=[space separated feature list]' \ + '--all-features[enable all available features]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ '--manifest-path=[path to manifest]: :_files -/' \ @@ -131,6 +134,7 @@ case $state in '--debug[build in debug mode instead of release mode]' \ '--example[install the specified example instead of binaries]' \ '--features=[space separated feature list]' \ + '--all-features[enable all available features]' \ '--git=[URL from which to install the crate]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ @@ -168,6 +172,7 @@ case $state in '--no-default-features[do not include the default feature]' \ '--manifest-path=[path to manifest]: :_files -/' \ '--features=[space separated feature list]' \ + '--all-features[enable all available features]' \ '--format-version=[format version(default: 1)]' \ '--color=:colorization option:(auto always never)' \ ;; @@ -241,6 +246,7 @@ case $state in _arguments \ '--example=[name of the bin target]' \ '--features=[space separated feature list]' \ + '--all-features[enable all available features]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ '--manifest-path=[path to manifest]: :_files -/' \ @@ -258,6 +264,7 @@ case $state in _arguments \ '--color=:colorization option:(auto always never)' \ '--features=[features to compile for the package]' \ + '--all-features[enable all available features]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \ '--manifest-path=[path to the manifest to fetch dependencies for]' \ @@ -275,6 +282,7 @@ case $state in _arguments \ '--color=:colorization option:(auto always never)' \ '--features=[space-separated list of features to also build]' \ + '--all-features[enable all available features]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \ '--manifest-path=[path to the manifest to document]' \ @@ -301,6 +309,7 @@ case $state in test) _arguments \ '--features=[space separated feature list]' \ + '--all-features[enable all available features]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ '--manifest-path=[path to manifest]: :_files -/' \ diff --git a/src/etc/cargo.bashcomp.sh b/src/etc/cargo.bashcomp.sh index b1652b6cc2a..5c6675e9069 100644 --- a/src/etc/cargo.bashcomp.sh +++ b/src/etc/cargo.bashcomp.sh @@ -17,7 +17,7 @@ _cargo() local opt_color='--color' local opt_common="$opt_help $opt_verbose $opt_quiet $opt_color" local opt_pkg='-p --package' - local opt_feat='--features --no-default-features' + local opt_feat='--features --all-features --no-default-features' local opt_mani='--manifest-path' local opt_jobs='-j --jobs' diff --git a/src/etc/man/cargo-bench.1 b/src/etc/man/cargo-bench.1 index 7f32d196dcc..dfb9ee4ec61 100644 --- a/src/etc/man/cargo-bench.1 +++ b/src/etc/man/cargo-bench.1 @@ -83,6 +83,11 @@ Space\-separated list of features to also build. .RS .RE .TP +.B \-\-all\-features +Build all available features. +.RS +.RE +.TP .B \-\-no\-default\-features Do not build the \f[C]default\f[] feature. .RS diff --git a/src/etc/man/cargo-build.1 b/src/etc/man/cargo-build.1 index e4c00dc2110..18c16c63da1 100644 --- a/src/etc/man/cargo-build.1 +++ b/src/etc/man/cargo-build.1 @@ -67,6 +67,11 @@ Build artifacts in release mode, with optimizations. .RS .RE .TP +.B \-\-all\-features +Build all available features. +.RS +.RE +.TP .B \-\-features \f[I]FEATURES\f[] Space\-separated list of features to also build. .RS diff --git a/src/etc/man/cargo-doc.1 b/src/etc/man/cargo-doc.1 index 54807f65486..f910957c693 100644 --- a/src/etc/man/cargo-doc.1 +++ b/src/etc/man/cargo-doc.1 @@ -57,6 +57,11 @@ Space\-separated list of features to also build. .RS .RE .TP +.B \-\-all\-features +Build all available features. +.RS +.RE +.TP .B \-\-no\-default\-features Do not build the \f[C]default\f[] feature. .RS diff --git a/src/etc/man/cargo-install.1 b/src/etc/man/cargo-install.1 index 9944d9104d0..8822e730f72 100644 --- a/src/etc/man/cargo-install.1 +++ b/src/etc/man/cargo-install.1 @@ -98,6 +98,11 @@ Space\-separated list of features to activate. .RS .RE .TP +.B \-\-all\-features +Build all available features. +.RS +.RE +.TP .B \-f, \-\-force Force overwriting existing crates or binaries .RS diff --git a/src/etc/man/cargo-metadata.1 b/src/etc/man/cargo-metadata.1 index 939d0265648..69d72535cb6 100644 --- a/src/etc/man/cargo-metadata.1 +++ b/src/etc/man/cargo-metadata.1 @@ -22,6 +22,11 @@ Space-separated list of features. .RS .RE .TP +.B \-\-all\-features +Build all available features. +.RS +.RE +.TP .B \-\-no\-default\-features Do not include the \f[C]default\f[] feature. .RS diff --git a/src/etc/man/cargo-run.1 b/src/etc/man/cargo-run.1 index 91d0bfba6c6..80473d2be46 100644 --- a/src/etc/man/cargo-run.1 +++ b/src/etc/man/cargo-run.1 @@ -51,6 +51,11 @@ Space\-separated list of features to also build. .RS .RE .TP +.B \-\-all\-features +Build all available features. +.RS +.RE +.TP .B \-\-no\-default\-features Do not build the \f[C]default\f[] feature. .RS diff --git a/src/etc/man/cargo-rustc.1 b/src/etc/man/cargo-rustc.1 index b503fed1009..f5d9a3521a4 100644 --- a/src/etc/man/cargo-rustc.1 +++ b/src/etc/man/cargo-rustc.1 @@ -83,6 +83,11 @@ The version to yank or un\-yank. .RS .RE .TP +.B \-\-all\-features +Build all available features. +.RS +.RE +.TP .B \-\-no\-default\-features Do not compile default features for the package. .RS diff --git a/src/etc/man/cargo-rustdoc.1 b/src/etc/man/cargo-rustdoc.1 index 278e6088654..3a898a31a6b 100644 --- a/src/etc/man/cargo-rustdoc.1 +++ b/src/etc/man/cargo-rustdoc.1 @@ -81,6 +81,11 @@ Space-separated list of features to also build. .RS .RE .TP +.B \-\-all\-features +Build all available features. +.RS +.RE +.TP .B \-\-no\-default\-features Do not build the \f[C]default\f[] feature. .RS diff --git a/src/etc/man/cargo-test.1 b/src/etc/man/cargo-test.1 index 63f1b2b801d..2d9907f0bd0 100644 --- a/src/etc/man/cargo-test.1 +++ b/src/etc/man/cargo-test.1 @@ -107,6 +107,11 @@ Space\-separated list of features to also build. .RS .RE .TP +.B \-\-all\-features +Build all available features. +.RS +.RE +.TP .B \-\-no\-default\-features Do not build the \f[C]default\f[] feature. .RS diff --git a/tests/features.rs b/tests/features.rs index 1551c703c22..a6921de3814 100644 --- a/tests/features.rs +++ b/tests/features.rs @@ -960,4 +960,48 @@ fn dep_feature_in_cmd_line() { execs().with_status(101).with_stderr("\ [ERROR] feature names may not contain slashes: `bar/some-feat` ")); + +#[test] +fn all_features_flag_enables_all_features() { + let p = project("foo") + .file("Cargo.toml", r#" + [project] + name = "foo" + version = "0.0.1" + authors = [] + + [features] + foo = [] + bar = [] + + [dependencies.baz] + path = "baz" + optional = true + "#) + .file("src/main.rs", r#" + #[cfg(feature = "foo")] + pub fn foo() {} + + #[cfg(feature = "bar")] + pub fn bar() { + extern crate baz; + baz::baz(); + } + + fn main() { + foo(); + bar(); + } + "#) + .file("baz/Cargo.toml", r#" + [package] + name = "baz" + version = "0.0.1" + authors = [] + "#) + .file("baz/src/lib.rs", "pub fn baz() {}"); + + assert_that(p.cargo_process("build").arg("--all-features"), + execs().with_status(0)); +} }