1 #![warn(rust_2018_idioms)]
2 #![cfg(feature = "full")]
3 #![cfg(unix)]
4 #![cfg(not(miri))] // No `sigaction` on Miri.
5 
6 mod support {
7     pub mod signal;
8 }
9 use support::signal::send_signal;
10 
11 use tokio::signal::unix::{signal, SignalKind};
12 
13 #[tokio::test]
twice()14 async fn twice() {
15     let kind = SignalKind::user_defined1();
16     let mut sig = signal(kind).expect("failed to get signal");
17 
18     for _ in 0..2 {
19         send_signal(libc::SIGUSR1);
20 
21         assert!(sig.recv().await.is_some());
22     }
23 }
24