Fix remaining test failures
authorTatsuyuki Ishi <ishitatsuyuki@gmail.com>
Sun, 27 Aug 2017 07:31:16 +0000 (16:31 +0900)
committerTatsuyuki Ishi <ishitatsuyuki@gmail.com>
Sun, 27 Aug 2017 07:31:16 +0000 (16:31 +0900)
tests/features.rs
tests/git.rs
tests/path.rs
tests/run.rs
tests/test.rs

index 7aec1b99e069abe54a9e2b203da31c2bb5130ec5..bbc78b9420ebad8d42cda5e128604c0888ea119d 100644 (file)
@@ -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() {}
         "#)
index 369ed7f14ad989b71e517f4b557546a719d69687..ca0f209f39f186b75d6951c7745fdc5fe2b17117 100644 (file)
@@ -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() {}
         "#)
index 1003c09edc53be8c568d91dab3493181c846f7fc..e07334c61802045ed82ee2fb5c5e38d875a7d50b 100644 (file)
@@ -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#"
index 83d957b814c1eaf6f9bb130d0d1c1c0dca606506..569288615ebf8705f1551c89dd3c0455da5b9fe0 100644 (file)
@@ -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"); }
         "#);
index b4dc3b0c6ec94356711bf235eb45e364fead416d..017a39d80931a5dd3ab98ecaa53107577c473a3b 100644 (file)
@@ -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"