2018-07-15 20:22:34 -07:00
|
|
|
#![cfg(unix)]
|
2019-05-14 10:27:36 -07:00
|
|
|
#![deny(warnings, rust_2018_idioms)]
|
2019-07-03 10:40:59 -07:00
|
|
|
#![feature(async_await)]
|
2018-07-15 20:22:34 -07:00
|
|
|
|
2018-07-28 12:30:46 -07:00
|
|
|
pub mod support;
|
2019-05-14 10:27:36 -07:00
|
|
|
use crate::support::*;
|
|
|
|
|
|
|
|
|
|
use libc;
|
2018-07-15 20:22:34 -07:00
|
|
|
|
2019-07-03 10:40:59 -07:00
|
|
|
#[tokio::test]
|
|
|
|
|
async fn simple() {
|
|
|
|
|
let signal = with_timeout(Signal::new(libc::SIGUSR1))
|
|
|
|
|
.await
|
|
|
|
|
.expect("failed to create signal");
|
2018-07-28 12:30:46 -07:00
|
|
|
|
|
|
|
|
send_signal(libc::SIGUSR1);
|
|
|
|
|
|
2019-07-09 08:48:46 -07:00
|
|
|
let _ = with_timeout(signal.into_future()).await;
|
2018-07-15 20:22:34 -07:00
|
|
|
}
|