diff options
| author | Wayne Warren <wayne.warren.s@gmail.com> | 2018-11-30 12:54:47 -0600 |
|---|---|---|
| committer | Wayne Warren <wayne.warren.s@gmail.com> | 2018-12-05 18:18:17 -0600 |
| commit | 0442bb9ce0b1f9851442fcc6f8f9dcb3ef88e3ca (patch) | |
| tree | ae30e8d02f422116840360fec534bf80f9a1f68d | |
| parent | 87d517df5db7597ab03a7cf0b8083f55a3cee8b7 (diff) | |
| download | rust-0442bb9ce0b1f9851442fcc6f8f9dcb3ef88e3ca.tar.gz rust-0442bb9ce0b1f9851442fcc6f8f9dcb3ef88e3ca.zip | |
Don't change current working directory of cargo tests
| -rw-r--r-- | tests/dogfood.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/dogfood.rs b/tests/dogfood.rs index 286af42fd91..c1f02b9fcef 100644 --- a/tests/dogfood.rs +++ b/tests/dogfood.rs @@ -8,11 +8,6 @@ // except according to those terms. #[test] -fn dogfood_runner() { - dogfood(); - dogfood_tests(); -} - fn dogfood() { if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) { return; @@ -23,8 +18,8 @@ fn dogfood() { .join(env!("PROFILE")) .join("cargo-clippy"); - std::env::set_current_dir(root_dir).unwrap(); let output = std::process::Command::new(clippy_cmd) + .current_dir(root_dir) .env("CLIPPY_DOGFOOD", "1") .arg("clippy") .arg("--all-targets") @@ -42,6 +37,7 @@ fn dogfood() { assert!(output.status.success()); } +#[test] fn dogfood_tests() { if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) { return; @@ -60,8 +56,8 @@ fn dogfood_tests() { "clippy_dev", "rustc_tools_util", ] { - std::env::set_current_dir(root_dir.join(d)).unwrap(); let output = std::process::Command::new(&clippy_cmd) + .current_dir(root_dir.join(d)) .env("CLIPPY_DOGFOOD", "1") .arg("clippy") .arg("--") |
