diff options
author | Carl Lerche <me@carllerche.com> | 2019-10-25 12:50:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-25 12:50:15 -0700 |
commit | 227533d456fe32e48ffcd3796f1e6c8f9318b230 (patch) | |
tree | 498029aaf42dd64eeb8ef0e7d7f29802b45d4e95 /tokio/tests/signal_usr1.rs | |
parent | 03a9378297c73c2e56a6d6b55db22b92427b850a (diff) |
net: move into tokio crate (#1683)
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.
Diffstat (limited to 'tokio/tests/signal_usr1.rs')
-rw-r--r-- | tokio/tests/signal_usr1.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tokio/tests/signal_usr1.rs b/tokio/tests/signal_usr1.rs new file mode 100644 index 00000000..9b6a0dec --- /dev/null +++ b/tokio/tests/signal_usr1.rs @@ -0,0 +1,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; +} |