mirror of
https://github.com/rust-lang/cargo
synced 2024-10-06 15:59:39 +00:00
Fix remaining test failures
This commit is contained in:
parent
04a24b438b
commit
000a079b52
|
@ -516,7 +516,9 @@ fn groups_on_groups_on_groups() {
|
|||
optional = true
|
||||
"#)
|
||||
.file("src/main.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate bar;
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate baz;
|
||||
fn main() {}
|
||||
"#)
|
||||
|
@ -562,7 +564,9 @@ fn many_cli_features() {
|
|||
optional = true
|
||||
"#)
|
||||
.file("src/main.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate bar;
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate baz;
|
||||
fn main() {}
|
||||
"#)
|
||||
|
@ -607,6 +611,7 @@ fn union_features() {
|
|||
features = ["f2"]
|
||||
"#)
|
||||
.file("src/main.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate d1;
|
||||
extern crate d2;
|
||||
fn main() {
|
||||
|
@ -1100,7 +1105,9 @@ fn many_cli_features_comma_delimited() {
|
|||
optional = true
|
||||
"#)
|
||||
.file("src/main.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate bar;
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate baz;
|
||||
fn main() {}
|
||||
"#)
|
||||
|
@ -1154,9 +1161,13 @@ fn many_cli_features_comma_and_space_delimited() {
|
|||
optional = true
|
||||
"#)
|
||||
.file("src/main.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate bar;
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate baz;
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate bam;
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate bap;
|
||||
fn main() {}
|
||||
"#)
|
||||
|
|
|
@ -644,7 +644,9 @@ fn update_with_shared_deps() {
|
|||
path = "dep2"
|
||||
"#)
|
||||
.file("src/main.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate dep1;
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate dep2;
|
||||
fn main() {}
|
||||
"#)
|
||||
|
|
|
@ -744,7 +744,7 @@ fn dev_deps_no_rebuild_lib() {
|
|||
doctest = false
|
||||
"#)
|
||||
.file("src/lib.rs", r#"
|
||||
#[cfg(test)] extern crate bar;
|
||||
#[cfg(test)] #[allow(unused_extern_crates)] extern crate bar;
|
||||
#[cfg(not(test))] pub fn foo() { env!("FOO"); }
|
||||
"#)
|
||||
.file("bar/Cargo.toml", r#"
|
||||
|
|
|
@ -280,10 +280,12 @@ fn specify_name() {
|
|||
"#)
|
||||
.file("src/lib.rs", "")
|
||||
.file("src/bin/a.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate foo;
|
||||
fn main() { println!("hello a.rs"); }
|
||||
"#)
|
||||
.file("src/bin/b.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate foo;
|
||||
fn main() { println!("hello b.rs"); }
|
||||
"#);
|
||||
|
|
|
@ -331,6 +331,7 @@ fn test_with_lib_dep() {
|
|||
#[test] fn lib_test() {}
|
||||
"#)
|
||||
.file("src/main.rs", "
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate foo;
|
||||
|
||||
fn main() {}
|
||||
|
@ -364,6 +365,7 @@ fn test_with_deep_lib_dep() {
|
|||
path = "../foo"
|
||||
"#)
|
||||
.file("src/lib.rs", "
|
||||
#[cfg(test)]
|
||||
extern crate foo;
|
||||
/// ```
|
||||
/// bar::bar();
|
||||
|
@ -587,6 +589,7 @@ fn lib_bin_same_name() {
|
|||
#[test] fn lib_test() {}
|
||||
")
|
||||
.file("src/main.rs", "
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate foo;
|
||||
|
||||
#[test]
|
||||
|
@ -1288,7 +1291,7 @@ fn selective_testing() {
|
|||
doctest = false
|
||||
"#)
|
||||
.file("d1/src/lib.rs", "")
|
||||
.file("d1/src/main.rs", "extern crate d1; fn main() {}")
|
||||
.file("d1/src/main.rs", "#[allow(unused_extern_crates)] extern crate d1; fn main() {}")
|
||||
.file("d2/Cargo.toml", r#"
|
||||
[package]
|
||||
name = "d2"
|
||||
|
@ -1300,7 +1303,7 @@ fn selective_testing() {
|
|||
doctest = false
|
||||
"#)
|
||||
.file("d2/src/lib.rs", "")
|
||||
.file("d2/src/main.rs", "extern crate d2; fn main() {}");
|
||||
.file("d2/src/main.rs", "#[allow(unused_extern_crates)] extern crate d2; fn main() {}");
|
||||
p.build();
|
||||
|
||||
println!("d1");
|
||||
|
@ -1361,6 +1364,7 @@ fn almost_cyclic_but_not_quite() {
|
|||
path = ".."
|
||||
"#)
|
||||
.file("b/src/lib.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate a;
|
||||
"#)
|
||||
.file("c/Cargo.toml", r#"
|
||||
|
@ -1388,8 +1392,14 @@ fn build_then_selective_test() {
|
|||
[dependencies.b]
|
||||
path = "b"
|
||||
"#)
|
||||
.file("src/lib.rs", "extern crate b;")
|
||||
.file("src/main.rs", "extern crate b; extern crate a; fn main() {}")
|
||||
.file("src/lib.rs", "#[allow(unused_extern_crates)] extern crate b;")
|
||||
.file("src/main.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate b;
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate a;
|
||||
fn main() {}
|
||||
"#)
|
||||
.file("b/Cargo.toml", r#"
|
||||
[package]
|
||||
name = "b"
|
||||
|
@ -1570,7 +1580,7 @@ fn example_with_dev_dep() {
|
|||
path = "a"
|
||||
"#)
|
||||
.file("src/lib.rs", "")
|
||||
.file("examples/ex.rs", "extern crate a; fn main() {}")
|
||||
.file("examples/ex.rs", "#[allow(unused_extern_crates)] extern crate a; fn main() {}")
|
||||
.file("a/Cargo.toml", r#"
|
||||
[package]
|
||||
name = "a"
|
||||
|
@ -1822,6 +1832,7 @@ fn cyclic_dev_dep_doc_test() {
|
|||
foo = { path = ".." }
|
||||
"#)
|
||||
.file("bar/src/lib.rs", r#"
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate foo;
|
||||
"#);
|
||||
assert_that(p.cargo_process("test"),
|
||||
|
@ -2179,7 +2190,7 @@ fn panic_abort_multiple() {
|
|||
[profile.release]
|
||||
panic = 'abort'
|
||||
"#)
|
||||
.file("src/lib.rs", "extern crate a;")
|
||||
.file("src/lib.rs", "#[allow(unused_extern_crates)] extern crate a;")
|
||||
.file("a/Cargo.toml", r#"
|
||||
[package]
|
||||
name = "a"
|
||||
|
@ -2296,7 +2307,7 @@ fn test_release_ignore_panic() {
|
|||
[profile.release]
|
||||
panic = 'abort'
|
||||
"#)
|
||||
.file("src/lib.rs", "extern crate a;")
|
||||
.file("src/lib.rs", "#[allow(unused_extern_crates)] extern crate a;")
|
||||
.file("a/Cargo.toml", r#"
|
||||
[package]
|
||||
name = "a"
|
||||
|
|
Loading…
Reference in a new issue