process: Remove caveat about tokio-signal

This commit is contained in:
Alex Crichton
2019-06-24 16:56:49 -07:00
committed by Ivan Petkov
parent 01b5bf6761
commit 1aee22505a
5 changed files with 1 additions and 45 deletions
-2
View File
@@ -8,8 +8,6 @@ mod support;
#[test]
fn simple() {
support::init();
let mut lp = Core::new().unwrap();
let mut cmd = support::cmd("exit");
cmd.arg("2");
-6
View File
@@ -83,8 +83,6 @@ fn feed_cat(mut cat: Child, n: usize) -> BoxFuture<ExitStatus, io::Error> {
///
/// - The child does produce EOF on stdout after the last line.
fn feed_a_lot() {
support::init();
let mut lp = Core::new().unwrap();
let child = cat().spawn_async(&lp.handle()).unwrap();
let status = lp.run(feed_cat(child, 10000)).unwrap();
@@ -93,8 +91,6 @@ fn feed_a_lot() {
#[test]
fn drop_kills() {
support::init();
let mut lp = Core::new().unwrap();
let mut child = cat().spawn_async(&lp.handle()).unwrap();
let stdin = child.stdin().take().unwrap();
@@ -108,8 +104,6 @@ fn drop_kills() {
#[test]
fn wait_with_output_captures() {
support::init();
let mut core = Core::new().unwrap();
let mut child = cat().spawn_async(&core.handle()).unwrap();
-26
View File
@@ -5,32 +5,6 @@ extern crate tokio_process;
use std::env;
use std::process::Command;
use std::sync::{Once, ONCE_INIT};
use std::thread;
use std::sync::mpsc::channel;
use self::tokio_core::reactor::Core;
use self::futures::future;
use self::tokio_process::CommandExt;
pub fn init() {
static INIT: Once = ONCE_INIT;
INIT.call_once(|| {
drop(env_logger::init());
let (tx, rx) = channel();
thread::spawn(move || {
let mut lp = Core::new().unwrap();
let mut cmd = cmd("exit");
let mut child = cmd.spawn_async(&lp.handle()).unwrap();
drop(child.kill());
lp.run(child).unwrap();
tx.send(()).unwrap();
drop(lp.run(future::empty::<(), ()>()));
});
rx.recv().unwrap();
});
}
pub fn cmd(s: &str) -> Command {
let mut me = env::current_exe().unwrap();