]> git.proxmox.com Git - cargo.git/commitdiff
Track rust master
authorCarl Lerche <me@carllerche.com>
Wed, 9 Apr 2014 20:28:10 +0000 (13:28 -0700)
committerCarl Lerche <me@carllerche.com>
Wed, 9 Apr 2014 20:28:10 +0000 (13:28 -0700)
libs/rust-toml
src/bin/cargo-compile.rs
src/cargo/mod.rs
tests/support.rs
tests/test_cargo_compile.rs

index a7c9ead90b7eb51521f3578307fe44ca8f087b9a..c6bd1115bd8403170f69b248270c05e63fd0e249 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a7c9ead90b7eb51521f3578307fe44ca8f087b9a
+Subproject commit c6bd1115bd8403170f69b248270c05e63fd0e249
index cb41fa337a72952f7e56da18c31d1c56750d637c..259572e5ca9609fb86b35fa1d659d5a2527a2aae 100644 (file)
@@ -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<T: FlagConfig + Decodable<FlagDecoder, HammerError>>() -> CargoResult<T
     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)
 }
 
index 4c9811441d6210bcdfa2402a8a14630dec56d72f..51425231e0cd8579d8ec83f178b1d3d3ba4d9b7e 100644 (file)
@@ -73,7 +73,7 @@ impl<E> ToCargoErrorMessage<E> for ~str {
     }
 }
 
-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)
     }
index 79ea19f3ae77310d87936076b255f1a2fa5c8e40..bfce652544a2694660f27b827288ca420fd5eec9 100644 (file)
@@ -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<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))
index 6f25ea270c82c9cbe9cf8e981c4485f112736bc5..02b1cc4a3e322dc18827a3515696fc1ccb1bb947 100644 (file)
@@ -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());