Skip to content

Commit

Permalink
hack to get the tests to work. see rust-lang/cargo#879
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Nov 15, 2014
1 parent 0625ff8 commit 98d6c26
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 23 additions & 1 deletion test/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
extern crate capnpc;

fn main() {
::capnpc::compile(Path::new("."), [Path::new("test.capnp")]);

// See https://github.com/rust-lang/cargo/issues/879
//::capnpc::compile(Path::new("."), [Path::new("test.capnp")]);

let mut command = ::std::io::Command::new("capnp");
command
.arg("compile")
.arg("-o/bin/cat")
.arg("test.capnp");

command.stdout(::std::io::process::CreatePipe(false, true));

match command.spawn() {
Ok(ref mut p) => {
let mut child_stdout = p.stdout.take().unwrap();
::capnpc::codegen::main(&mut child_stdout).unwrap();
p.wait().unwrap();
}
Err(e) => {
panic!("could not start process: {}", e);
}
}

}
4 changes: 3 additions & 1 deletion test/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ extern crate capnp;

#[allow(overflowing_literals)]
pub mod test_capnp {
include!(concat!(env!("OUT_DIR"), "/test_capnp.rs"))
// See https://github.com/rust-lang/cargo/issues/879
// include!(concat!(env!("OUT_DIR"), "/test_capnp.rs"))
include!("test_capnp.rs")
}

#[cfg(test)]
Expand Down

0 comments on commit 98d6c26

Please sign in to comment.