mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `net` implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags.
24 lines
442 B
Rust
24 lines
442 B
Rust
#![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;
|
|
}
|