diff --git a/tests/testsuite/workspaces.rs b/tests/testsuite/workspaces.rs index 35ec7a52e75..3b6e6f22b27 100644 --- a/tests/testsuite/workspaces.rs +++ b/tests/testsuite/workspaces.rs @@ -4,7 +4,7 @@ use std::io::{Read, Write}; use crate::support::registry::Package; use crate::support::sleep_ms; -use crate::support::{basic_lib_manifest, basic_manifest, git, project}; +use crate::support::{basic_lib_manifest, basic_manifest, cross_compile, git, project}; #[cargo_test] fn simple_explicit() { @@ -2173,3 +2173,58 @@ Caused by: ) .run(); } + +#[cargo_test] +fn simple_with_build_config() { + let p = project() + .file( + "Cargo.toml", + r#" + [project] + name = "foo" + version = "0.1.0" + authors = [] + + [workspace] + members = ["bar"] + "#, + ) + .file( + "bar/.cargo/config", + r#" + [build] + target-file = "target.json" + "#, + ) + .file( + "bar/.cargo/target.json", + r#" + { + "dll-suffix": ".wasm", + } + "#, + ) + .file("src/main.rs", "fn main() {}") + .file( + "bar/Cargo.toml", + r#" + [project] + name = "bar" + version = "0.1.0" + authors = [] + workspace = ".." + + [lib] + crate-type = ["cdylib"] + "#, + ) + .file("bar/src/lib.rs", "fn main() {}"); + let p = p.build(); + + p.cargo("build --all").run(); + assert!(p.bin("foo").is_file()); + assert!(p.target_debug_dir().join("bar.wasm").is_file()); + + assert!(p.root().join("Cargo.lock").is_file()); + assert!(!p.root().join("bar/Cargo.lock").is_file()); +}