-Subproject commit a7c9ead90b7eb51521f3578307fe44ca8f087b9a
+Subproject commit c6bd1115bd8403170f69b248270c05e63fd0e249
extern crate hammer;
extern crate cargo;
+use std::vec::Vec;
use serialize::{Decodable};
use hammer::{FlagDecoder,FlagConfig,FlagConfiguration,HammerError};
use std::io;
Decodable::decode(&mut decoder).to_cargo_error(|e: HammerError| e.message, 1)
}
-fn read_manifest(manifest_path: &str) -> CargoResult<~[u8]> {
+fn read_manifest(manifest_path: &str) -> CargoResult<Vec<u8>> {
Ok((try!(exec_with_output("cargo-read-manifest", [~"--manifest-path", manifest_path.to_owned()], None))).output)
}
}
}
-impl<E> ToCargoErrorMessage<E> for 'static |E| -> ~str {
+impl<'a, E> ToCargoErrorMessage<E> for |E|:'a -> ~str {
fn to_cargo_error_message(self, err: E) -> ~str {
self(err)
}
use std::os;
use std::path::{Path};
use std::str;
+use std::vec::Vec;
use ham = hamcrest;
use cargo::util::{process,ProcessBuilder};
fn match_output(&self, actual: &ProcessOutput) -> ham::MatchResult {
self.match_status(actual.status)
- .and(self.match_stdout(actual.output))
+ .and(self.match_stdout(&actual.output))
}
fn match_status(&self, actual: ProcessExit) -> ham::MatchResult {
}
}
- fn match_stdout(&self, actual: &[u8]) -> ham::MatchResult {
+ fn match_stdout(&self, actual: &Vec<u8>) -> ham::MatchResult {
match self.expect_stdout.as_ref().map(|s| s.as_slice()) {
None => ham::success(),
Some(out) => {
- match str::from_utf8(actual) {
+ match str::from_utf8(actual.as_slice()) {
None => Err(~"stdout was not utf8 encoded"),
Some(actual) => {
ham::expect(actual == out, format!("stdout was `{}`", actual))
-use std;
use support::{project,execs};
use hamcrest::{assert_that,existing_file};
use cargo;
}"#)
.build();
- let output = p.cargo_process("cargo-compile")
+ p.cargo_process("cargo-compile")
.args([~"--manifest-path", ~"Cargo.toml"])
- .exec_with_output();
-
- match output {
- Ok(out) => {
- println!("out:\n{}\n", std::str::from_utf8(out.output));
- println!("err:\n{}\n", std::str::from_utf8(out.error));
- },
- Err(e) => println!("err: {}", e)
- }
+ .exec_with_output()
+ .unwrap();
assert_that(&p.root().join("target/foo"), existing_file());