]> git.lizzy.rs Git - rust.git/blobdiff - tests/compile-test.rs
Auto merge of #8330 - flip1995:changelog, r=llogiq
[rust.git] / tests / compile-test.rs
index a2d58491872b30813e99e0bb2685478183c6dc74..6505028db9fadc1f5e75e62e468bcde1d805d737 100644 (file)
@@ -1,4 +1,5 @@
 #![feature(test)] // compiletest_rs requires this attribute
+#![feature(once_cell)]
 #![cfg_attr(feature = "deny-warnings", deny(warnings))]
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
 use std::fs;
 use std::io;
 use std::path::{Path, PathBuf};
+use test_utils::IS_RUSTC_TEST_SUITE;
 
-mod cargo;
+mod test_utils;
 
 // whether to run internal tests or not
-const RUN_INTERNAL_TESTS: bool = cfg!(feature = "internal-lints");
+const RUN_INTERNAL_TESTS: bool = cfg!(feature = "internal");
 
 /// All crates used in UI tests are listed here
 static TEST_DEPENDENCIES: &[&str] = &[
     "clippy_utils",
     "derive_new",
+    "futures",
     "if_chain",
     "itertools",
     "quote",
@@ -28,6 +31,7 @@
     "serde",
     "serde_derive",
     "syn",
+    "tokio",
     "parking_lot",
 ];
 
@@ -38,6 +42,8 @@
 #[allow(unused_extern_crates)]
 extern crate derive_new;
 #[allow(unused_extern_crates)]
+extern crate futures;
+#[allow(unused_extern_crates)]
 extern crate if_chain;
 #[allow(unused_extern_crates)]
 extern crate itertools;
@@ -47,6 +53,8 @@
 extern crate quote;
 #[allow(unused_extern_crates)]
 extern crate syn;
+#[allow(unused_extern_crates)]
+extern crate tokio;
 
 /// Produces a string with an `--extern` flag for all UI test crate
 /// dependencies.
@@ -298,7 +306,7 @@ fn run_tests(
         Ok(result)
     }
 
-    if cargo::is_rustc_test_suite() {
+    if IS_RUSTC_TEST_SUITE {
         return;
     }
 
@@ -320,15 +328,9 @@ fn run_tests(
     }
 }
 
-fn prepare_env() {
-    set_var("CLIPPY_DISABLE_DOCS_LINKS", "true");
-    set_var("__CLIPPY_INTERNAL_TESTS", "true");
-    //set_var("RUST_BACKTRACE", "0");
-}
-
 #[test]
 fn compile_test() {
-    prepare_env();
+    set_var("CLIPPY_DISABLE_DOCS_LINKS", "true");
     let mut config = default_config();
     run_ui(&mut config);
     run_ui_test(&mut config);