]> git.lizzy.rs Git - rust.git/blobdiff - tests/integration.rs
Make tidy check for magic numbers that spell things
[rust.git] / tests / integration.rs
index 8cc78c98a6543f006740bafe7b14cb7b7fa19f79..c64425fa01a42a36b8351e934ae81523d75b7129 100644 (file)
@@ -1,6 +1,9 @@
 #![cfg(feature = "integration")]
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![warn(rust_2018_idioms, unused_lifetimes)]
 
 use std::env;
+use std::ffi::OsStr;
 use std::process::Command;
 
 #[cfg_attr(feature = "integration", test)]
@@ -16,7 +19,12 @@ fn integration_test() {
     repo_dir.push(crate_name);
 
     let st = Command::new("git")
-        .args(&["clone", "--depth=1", &repo_url, repo_dir.to_str().unwrap()])
+        .args(&[
+            OsStr::new("clone"),
+            OsStr::new("--depth=1"),
+            OsStr::new(&repo_url),
+            OsStr::new(&repo_dir),
+        ])
         .status()
         .expect("unable to run git");
     assert!(st.success());
@@ -58,11 +66,19 @@ fn integration_test() {
     } else if stderr.contains("query stack during panic") {
         panic!("query stack during panic in the output");
     } else if stderr.contains("E0463") {
+        // Encountering E0463 (can't find crate for `x`) did _not_ cause the build to fail in the
+        // past. Even though it should have. That's why we explicitly panic here.
+        // See PR #3552 and issue #3523 for more background.
         panic!("error: E0463");
     } else if stderr.contains("E0514") {
         panic!("incompatible crate versions");
     } else if stderr.contains("failed to run `rustc` to learn about target-specific information") {
         panic!("couldn't find librustc_driver, consider setting `LD_LIBRARY_PATH`");
+    } else {
+        assert!(
+            !stderr.contains("toolchain") || !stderr.contains("is not installed"),
+            "missing required toolchain"
+        );
     }
 
     match output.status.code() {