diff --git a/libs/rust-toml b/libs/rust-toml index a7c9ead90..c6bd1115b 160000 --- a/libs/rust-toml +++ b/libs/rust-toml @@ -1 +1 @@ -Subproject commit a7c9ead90b7eb51521f3578307fe44ca8f087b9a +Subproject commit c6bd1115bd8403170f69b248270c05e63fd0e249 diff --git a/src/bin/cargo-compile.rs b/src/bin/cargo-compile.rs index cb41fa337..259572e5c 100644 --- a/src/bin/cargo-compile.rs +++ b/src/bin/cargo-compile.rs @@ -5,6 +5,7 @@ extern crate serialize; extern crate hammer; extern crate cargo; +use std::vec::Vec; use serialize::{Decodable}; use hammer::{FlagDecoder,FlagConfig,FlagConfiguration,HammerError}; use std::io; @@ -40,7 +41,7 @@ fn flags>() -> CargoResult CargoResult<~[u8]> { +fn read_manifest(manifest_path: &str) -> CargoResult> { Ok((try!(exec_with_output("cargo-read-manifest", [~"--manifest-path", manifest_path.to_owned()], None))).output) } diff --git a/src/cargo/mod.rs b/src/cargo/mod.rs index 4c9811441..51425231e 100644 --- a/src/cargo/mod.rs +++ b/src/cargo/mod.rs @@ -73,7 +73,7 @@ impl ToCargoErrorMessage for ~str { } } -impl ToCargoErrorMessage for 'static |E| -> ~str { +impl<'a, E> ToCargoErrorMessage for |E|:'a -> ~str { fn to_cargo_error_message(self, err: E) -> ~str { self(err) } diff --git a/tests/support.rs b/tests/support.rs index 79ea19f3a..bfce65254 100644 --- a/tests/support.rs +++ b/tests/support.rs @@ -4,6 +4,7 @@ use std::io::process::{ProcessOutput,ProcessExit}; use std::os; use std::path::{Path}; use std::str; +use std::vec::Vec; use ham = hamcrest; use cargo::util::{process,ProcessBuilder}; @@ -167,7 +168,7 @@ impl Execs { 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 { @@ -181,11 +182,11 @@ impl Execs { } } - fn match_stdout(&self, actual: &[u8]) -> ham::MatchResult { + fn match_stdout(&self, actual: &Vec) -> 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)) diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index 6f25ea270..02b1cc4a3 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -1,4 +1,3 @@ -use std; use support::{project,execs}; use hamcrest::{assert_that,existing_file}; use cargo; @@ -25,17 +24,10 @@ test!(cargo_compile_with_explicit_manifest_path { }"#) .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());