diff --git a/tests/testsuite/rustc.rs b/tests/testsuite/rustc.rs index f1e72c0a5..57cec8689 100644 --- a/tests/testsuite/rustc.rs +++ b/tests/testsuite/rustc.rs @@ -231,6 +231,46 @@ fn build_with_crate_type_for_foo() { .run(); } +#[cargo_test] +fn build_with_crate_type_for_foo_with_deps() { + let p = project() + .file( + "src/lib.rs", + r#" + extern crate a; + pub fn foo() { a::hello(); } + "#, + ) + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.0.1" + authors = [] + + [dependencies] + a = { path = "a" } + "#, + ) + .file("a/Cargo.toml", &basic_manifest("a", "0.1.0")) + .file("a/src/lib.rs", "pub fn hello() {}") + .build(); + + p.cargo("rustc -v --crate-type cdylib -Zunstable-options") + .masquerade_as_nightly_cargo() + .with_stderr( + "\ +[COMPILING] a v0.1.0 ([CWD]/a) +[RUNNING] `rustc --crate-name a a/src/lib.rs [..]--crate-type lib [..] +[COMPILING] foo v0.0.1 ([CWD]) +[RUNNING] `rustc --crate-name foo src/lib.rs [..]--crate-type cdylib [..] +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] +", + ) + .run(); +} + #[cargo_test] fn build_with_crate_types_for_foo() { let p = project().file("src/lib.rs", "").build();