Once again, revert "Use pipes in compiletest"

This reverts commit 1d04b0ed5a.
This commit is contained in:
Eric Holk
2012-08-03 15:22:01 -07:00
parent 5012abde8f
commit 618d311c3d
2 changed files with 17 additions and 15 deletions

View File

@@ -8,6 +8,11 @@ import task;
import core::result; import core::result;
import result::{ok, err}; import result::{ok, err};
import comm::port;
import comm::chan;
import comm::send;
import comm::recv;
import common::config; import common::config;
import common::mode_run_pass; import common::mode_run_pass;
import common::mode_run_fail; import common::mode_run_fail;

View File

@@ -2,8 +2,6 @@ import run::spawn_process;
import io::{writer_util, reader_util}; import io::{writer_util, reader_util};
import libc::{c_int, pid_t}; import libc::{c_int, pid_t};
import pipes::chan;
export run; export run;
#[cfg(target_os = "win32")] #[cfg(target_os = "win32")]
@@ -60,30 +58,29 @@ fn run(lib_path: ~str,
writeclose(pipe_in.out, input); writeclose(pipe_in.out, input);
let p = pipes::port_set(); let p = comm::port();
let ch = p.chan(); let ch = comm::chan(p);
do task::spawn_sched(task::single_threaded) { do task::spawn_sched(task::single_threaded) {
let errput = readclose(pipe_err.in); let errput = readclose(pipe_err.in);
ch.send((2, errput)); comm::send(ch, (2, errput));
} }
let ch = p.chan();
do task::spawn_sched(task::single_threaded) { do task::spawn_sched(task::single_threaded) {
let output = readclose(pipe_out.in); let output = readclose(pipe_out.in);
ch.send((1, output)); comm::send(ch, (1, output));
} }
let status = run::waitpid(pid); let status = run::waitpid(pid);
let mut errs = ~""; let mut errs = ~"";
let mut outs = ~""; let mut outs = ~"";
let mut count = 2; let mut count = 2;
while count > 0 { while count > 0 {
alt p.recv() { let stream = comm::recv(p);
(1, s) { alt check stream {
outs = s; (1, s) {
} outs = s;
(2, s) { }
errs = s; (2, s) {
} errs = s;
_ { fail } }
}; };
count -= 1; count -= 1;
}; };