Integration tests working

Next up: cleanup
This commit is contained in:
Carlhuda 2014-03-19 18:25:14 -07:00
parent 07af6fdd4a
commit 3b350463af
4 changed files with 28 additions and 2 deletions

View File

@ -26,7 +26,7 @@ $(HAMMER): $(wildcard libs/hammer.rs/src/*.rs)
$(TOML): $(wildcard libs/rust-toml/src/toml/*.rs)
cd libs/rust-toml && make
$(HAMCREST): $(wildcard libs/hamcrest-rust/src/*.rs)
$(HAMCREST): $(wildcard libs/hamcrest-rust/src/hamcrest/*.rs)
cd libs/hamcrest-rust && make
# === Cargo

@ -1 +1 @@
Subproject commit 95f531ad8c726a832f28d171bde2860c77ec7619
Subproject commit 39f00624492fd648631041eadf1301a08cd2a482

View File

@ -1,7 +1,31 @@
use std;
use support::project;
use hamcrest::{SelfDescribing,Description,Matcher,assert_that};
use cargo;
#[deriving(Clone,Eq)]
pub struct ExistingFile;
impl SelfDescribing for ExistingFile {
fn describe_to(&self, desc: &mut Description) {
desc.append_text("an existing file");
}
}
impl Matcher<Path> for ExistingFile {
fn matches(&self, actual: &Path) -> bool {
actual.exists()
}
fn describe_mismatch(&self, actual: &Path, desc: &mut Description) {
desc.append_text(format!("`{}` was missing", actual.display()));
}
}
pub fn existing_file() -> ExistingFile {
ExistingFile
}
fn setup() {
}
@ -39,6 +63,7 @@ test!(cargo_compile_with_explicit_manifest_path {
Err(e) => println!("err: {}", e)
}
assert_that(p.root().join("target/foo/bar"), existing_file());
assert!(p.root().join("target/foo").exists(), "the executable exists");
let o = cargo::util::process("foo")

View File

@ -2,6 +2,7 @@
#[allow(deprecated_owned_vector)];
extern crate cargo;
extern crate hamcrest;
macro_rules! test(
($name:ident $expr:expr) => (