summaryrefslogtreecommitdiffstats
path: root/vendor/tokio/tests/signal_usr1.rs
blob: d74c7d31ab59776fab3b43a0dd75be2469333dc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![warn(rust_2018_idioms)]
#![cfg(feature = "full")]
#![cfg(unix)]

mod support {
    pub mod signal;
}
use support::signal::send_signal;

use tokio::signal::unix::{signal, SignalKind};
use tokio_test::assert_ok;

#[tokio::test]
async fn signal_usr1() {
    let mut signal = assert_ok!(
        signal(SignalKind::user_defined1()),
        "failed to create signal"
    );

    send_signal(libc::SIGUSR1);

    signal.recv().await;
}