Add mercy for devs that run cargo test without building

This commit is contained in:
Alex Butler 2018-05-29 00:38:47 +01:00
parent 5473c3fd92
commit cd925f0140
No known key found for this signature in database
GPG key ID: E1355A2F8E415521

View file

@ -900,6 +900,10 @@ fn rustfmt() -> PathBuf {
me.pop(); // chop of the test name
me.pop(); // chop off `deps`
me.push("rustfmt");
assert!(
me.is_file() || me.with_extension("exe").is_file(),
"no rustfmt bin, try running `cargo build` before testing"
);
return me;
}