]> git.lizzy.rs Git - rust.git/commitdiff
Use pipes in compiletest
authorEric Holk <eric.holk@gmail.com>
Wed, 25 Jul 2012 21:10:12 +0000 (14:10 -0700)
committerEric Holk <eric.holk@gmail.com>
Wed, 25 Jul 2012 22:15:46 +0000 (15:15 -0700)
src/compiletest/compiletest.rs
src/compiletest/procsrv.rs

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