2016-09-06 23:00:17 -07:00
|
|
|
#![cfg(unix)]
|
|
|
|
|
|
|
|
|
|
extern crate libc;
|
|
|
|
|
|
2018-07-28 12:30:46 -07:00
|
|
|
pub mod support;
|
|
|
|
|
use support::*;
|
2016-09-06 23:00:17 -07:00
|
|
|
|
2018-05-05 00:33:02 +02:00
|
|
|
#[test]
|
|
|
|
|
fn tokio_simple() {
|
2018-07-28 12:30:46 -07:00
|
|
|
let signal_future = Signal::new(libc::SIGUSR1)
|
|
|
|
|
.and_then(|signal| {
|
|
|
|
|
send_signal(libc::SIGUSR1);
|
|
|
|
|
signal.into_future().map(|_| ()).map_err(|(err, _)| err)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let mut rt = CurrentThreadRuntime::new()
|
|
|
|
|
.expect("failed to init runtime");
|
|
|
|
|
run_with_timeout(&mut rt, signal_future)
|
|
|
|
|
.expect("failed");
|
2018-05-05 00:33:02 +02:00
|
|
|
}
|