.map(PackageIdSpec::from_package_id)
.filter(|p| opt_out.iter().position(|x| *x == p.name()).is_none())
.collect(),
- Packages::Packages(ref packages) if packages.is_empty() => ws.current_opt()
- .map(Package::package_id)
- .map(PackageIdSpec::from_package_id)
- .into_iter()
- .collect(),
+ Packages::Packages(ref packages) if packages.is_empty() => {
+ vec![PackageIdSpec::from_package_id(ws.current()?.package_id())]
+ }
Packages::Packages(ref packages) => packages
.iter()
.map(|p| PackageIdSpec::parse(p))
use std::io::{Read, Write};
use cargotest::sleep_ms;
-use cargotest::support::{execs, git, project};
+use cargotest::support::{basic_lib_manifest, execs, git, project};
use cargotest::support::registry::Package;
use hamcrest::{assert_that, existing_dir, existing_file, is_not};
let file = format!("./foo{}", env::consts::EXE_SUFFIX);
assert_that(p.cargo("build").env("RUSTC", &file), execs().with_status(0));
}
+
+
+#[test]
+fn ws_rustc_err() {
+ let p = project("ws")
+ .file(
+ "Cargo.toml",
+ r#"
+ [workspace]
+ members = ["a"]
+ "#,
+ )
+ .file("a/Cargo.toml", &basic_lib_manifest("a"))
+ .file("a/src/lib.rs", "")
+ .build();
+
+ assert_that(
+ p.cargo("rustc"),
+ execs()
+ .with_status(101)
+ .with_stderr("[ERROR] [..]against an actual package[..]"),
+ );
+
+ assert_that(
+ p.cargo("rustdoc"),
+ execs()
+ .with_status(101)
+ .with_stderr("[ERROR] [..]against an actual package[..]"),
+ );
+}