Skip to content

Commit 66251c3

Browse files
committed
Use dogfood_runner for deterministic test ordering
1 parent 1db535a commit 66251c3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/dogfood.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@
88
// except according to those terms.
99

1010
#[test]
11+
fn dogfood_runner() {
12+
dogfood();
13+
dogfood_tests();
14+
}
15+
1116
fn dogfood() {
1217
if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
1318
return;
1419
}
1520
let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
1621
let clippy_cmd = std::path::Path::new(&root_dir).join("target/debug/cargo-clippy");
1722

18-
println!("{:?}", clippy_cmd);
23+
std::env::set_current_dir(root_dir).unwrap();
1924
let output = std::process::Command::new(clippy_cmd)
2025
.arg("clippy")
2126
.arg("--all-targets")
@@ -33,7 +38,6 @@ fn dogfood() {
3338
assert!(output.status.success());
3439
}
3540

36-
#[test]
3741
fn dogfood_tests() {
3842
if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
3943
return;
@@ -64,5 +68,4 @@ fn dogfood_tests() {
6468

6569
assert!(output.status.success());
6670
}
67-
std::env::set_current_dir(root_dir).unwrap();
6871
}

0 commit comments

Comments
 (0)