mirror of
https://github.com/rust-lang/cargo
synced 2024-10-03 22:43:59 +00:00
New test for cargo rustc --crate-type
with dependency
This commit is contained in:
parent
229c48a0b9
commit
497051a743
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue