Auto merge of #3701 - mikerite:fix-3118, r=phansch

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.
This commit is contained in:
bors 2019-01-26 09:56:07 +00:00
commit b1b55e8559
2 changed files with 8 additions and 2 deletions

View File

@ -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)

View File

@ -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"));