1 | #![warn(rust_2018_idioms)] |
---|---|
2 | #![cfg(feature = "full")] |
3 | #![cfg(unix)] |
4 | |
5 | mod support { |
6 | pub mod signal; |
7 | } |
8 | use support::signal::send_signal; |
9 | |
10 | use tokio::signal::unix::{signal, SignalKind}; |
11 | use tokio_test::assert_ok; |
12 | |
13 | #[tokio::test] |
14 | async fn signal_usr1() { |
15 | let mut signal = assert_ok!( |
16 | signal(SignalKind::user_defined1()), |
17 | "failed to create signal" |
18 | ); |
19 | |
20 | send_signal(libc::SIGUSR1); |
21 | |
22 | signal.recv().await; |
23 | } |
24 |