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

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

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

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

    send_signal(libc::SIGUSR1);

    let _ = signal.into_future().await;
}