dir = p.root().display(),
url = p.url()).as_slice()));
});
+
+test!(test_a_bench {
+ let p = project("foo")
+ .file("Cargo.toml", r#"
+ [project]
+ name = "foo"
+ authors = []
+ version = "0.1.0"
+
+ [lib]
+ name = "foo"
+ test = false
+ doctest = false
+
+ [[bench]]
+ name = "b"
+ test = true
+ "#)
+ .file("src/lib.rs", "")
+ .file("benches/b.rs", r#"
+ #[test]
+ fn foo() {}
+ "#);
+
+ assert_that(p.cargo_process("test"),
+ execs().with_status(0)
+ .with_stdout(format!("\
+{compiling} foo v0.1.0 ([..])
+{running} target[..]debug[..]b-[..]
+
+running 1 test
+test foo ... ok
+
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
+
+", compiling = COMPILING, running = RUNNING)));
+});
p.root().move_into_the_past().unwrap();
File::create(&bin).unwrap().write_all(b"fn foo() {}").unwrap();
+ // p.root().move_into_the_past().unwrap();
+ // p.root().join("target").move_into_the_past().unwrap();
// Make sure the binary is rebuilt, not the lib
assert_that(p.cargo("build")
execs().with_status(0));
File::create(&p.root().join("src/lib.rs")).unwrap();
+ p.root().move_into_the_past().unwrap();
+ p.root().join("target").move_into_the_past().unwrap();
assert_that(p.cargo("build"),
execs().with_status(0));