]> git.lizzy.rs Git - rust.git/commitdiff
Add mercy for devs that run `cargo test` without building
authorAlex Butler <alexheretic@gmail.com>
Mon, 28 May 2018 23:38:47 +0000 (00:38 +0100)
committerAlex Butler <alexheretic@gmail.com>
Mon, 28 May 2018 23:38:47 +0000 (00:38 +0100)
src/test/mod.rs

index d5c0533fde62aea128a3699197276c0e0a28f06a..3ac8caae291fcd8da0ec38c905b5af26e5a4a651 100644 (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;
 }