Skip to content

Commit 47f7ce4

Browse files
committed
hack to get the tests to work. see rust-lang/cargo#879
1 parent c54f7a8 commit 47f7ce4

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

test/build.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
extern crate capnpc;
22

33
fn main() {
4-
::capnpc::compile(Path::new("."), [Path::new("test.capnp")]);
4+
5+
// See https://github.com/rust-lang/cargo/issues/879
6+
//::capnpc::compile(Path::new("."), [Path::new("test.capnp")]);
7+
8+
let mut command = ::std::io::Command::new("capnp");
9+
command
10+
.arg("compile")
11+
.arg("-o/bin/cat")
12+
.arg("test.capnp");
13+
14+
command.stdout(::std::io::process::CreatePipe(false, true));
15+
16+
match command.spawn() {
17+
Ok(ref mut p) => {
18+
let mut child_stdout = p.stdout.take().unwrap();
19+
::capnpc::codegen::main(&mut child_stdout).unwrap();
20+
p.wait().unwrap();
21+
}
22+
Err(e) => {
23+
panic!("could not start process: {}", e);
24+
}
25+
}
26+
527
}

test/test.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ extern crate capnp;
1010

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

1618
#[cfg(test)]

0 commit comments

Comments
 (0)