Skip to content

Commit cd925f0

Browse files
committed
Add mercy for devs that run cargo test without building
1 parent 5473c3f commit cd925f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/test/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,10 @@ fn rustfmt() -> PathBuf {
900900
me.pop(); // chop of the test name
901901
me.pop(); // chop off `deps`
902902
me.push("rustfmt");
903+
assert!(
904+
me.is_file() || me.with_extension("exe").is_file(),
905+
"no rustfmt bin, try running `cargo build` before testing"
906+
);
903907
return me;
904908
}
905909

0 commit comments

Comments
 (0)