about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Wright <mikerite@lavabit.com>2019-01-26 11:10:13 +0200
committerMichael Wright <mikerite@lavabit.com>2019-01-26 11:10:13 +0200
commit94a6eb0695679c46387075c70efaaffb5b73cee0 (patch)
treedd8ae03ce228ee466abbd8c9b2ea2316e74e434b
parentc5325063c8fba725970c50708a4694902069cf35 (diff)
downloadrust-94a6eb0695679c46387075c70efaaffb5b73cee0.tar.gz
rust-94a6eb0695679c46387075c70efaaffb5b73cee0.zip
Fix dogfood tests on Appveyor
This introduces a work-around for a bug in rustup.rs when excuting
cargo from a custom toolchain. Instead of trusting rustup to
invoke cargo from one of the release channels we just invoke
nightly cargo directly.
-rw-r--r--src/main.rs6
-rw-r--r--tests/dogfood.rs4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index eefababb96d..20466fc567d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -97,6 +97,12 @@ where
         })
         .map(|p| ("CARGO_TARGET_DIR", p));
 
+    // Run the dogfood tests directly on nightly cargo. This is required due
+    // to a bug in rustup.rs when running cargo on custom toolchains. See issue #3118.
+    if std::env::var_os("CLIPPY_DOGFOOD").is_some() && cfg!(windows) {
+        args.insert(0, "+nightly".to_string());
+    }
+
     let exit_status = std::process::Command::new("cargo")
         .args(&args)
         .env("RUSTC_WRAPPER", path)
diff --git a/tests/dogfood.rs b/tests/dogfood.rs
index 87fe5887bcc..27a3d84da41 100644
--- a/tests/dogfood.rs
+++ b/tests/dogfood.rs
@@ -1,6 +1,6 @@
 #[test]
 fn dogfood() {
-    if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
+    if option_env!("RUSTC_TEST_SUITE").is_some() {
         return;
     }
     let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
@@ -30,7 +30,7 @@ fn dogfood() {
 
 #[test]
 fn dogfood_tests() {
-    if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
+    if option_env!("RUSTC_TEST_SUITE").is_some() {
         return;
     }
     let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));