pub fn run_async(cmd: &mut Command, should_succeed: bool) -> RecvWrapper {
    println!("Cmd: {:?}", cmd);
    let mut child = cmd.spawn().unwrap();
    thread::sleep(Duration::from_millis(500));

    let pid = pid_from_id(child.id());
    let (sender, receiver) = mpsc::sync_channel(0);

    let _handle = thread::spawn(move || {
        sender
            .send(child.wait().expect("wait").success())
            .expect("test didn't terminate in time, so chan is closed!");
    });
    RecvWrapper {
        receiver,
        pid,
        should_succeed,
    }
}
/// Run the cmd in a new process and send a message on receiver when it's done.
/// This allows for ensuring termination of a test.
Run the cmd in a new process and send a message on receiver when it's done.
This allows for ensuring termination of a test.
Run the cmd in a new process and send a message on receiver when it ' s done . This allows for ensuring termination of a test .
pub fn run_async(cmd: &mut Command, should_succeed: bool) -> RecvWrapper {
    println!("Cmd: {:?}", cmd);
    let mut child = cmd.spawn().unwrap();
    thread::sleep(Duration::from_millis(500));
    let pid = pid_from_id(child.id());
    let (sender, receiver) = mpsc::sync_channel(0);
    let _handle = thread::spawn(move || {
        sender
            .send(child.wait().expect("wait").success())
            .expect("test didn't terminate in time, so chan is closed!");
    });
    RecvWrapper {
        receiver,
        pid,
        should_succeed,
    }
}
pub fn run_async ( cmd : & mut Command , should_succeed : bool ) -> RecvWrapper { println ! ( " " cmd ) ; let mut child = cmd . spawn ( ) . unwrap ( ) ; thread :: sleep ( Duration :: from_millis ( 500 ) ) ; let pid = pid_from_id ( child . id ( ) ) ; let ( sender , receiver ) = mpsc :: sync_channel ( 0 ) ; let _handle = thread :: spawn ( move | | { sender . send ( child . wait ( ) . expect ( " " ) . success ( ) ) . expect ( " " ) ; } ) ; RecvWrapper { receiver , pid , should_succeed , } }
Run the cmd in a new process and send a message on receiver when it's done.
Run the cmd in a new process and send a message on receiver when it ' s done .
cmd
&mut Command
should_succeed
bool
cmd
&mut Command
should_succeed
bool