mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
20 lines
403 B
Rust
20 lines
403 B
Rust
#![cfg(unix)]
|
|
|
|
extern crate libc;
|
|
|
|
pub mod support;
|
|
use support::*;
|
|
|
|
#[test]
|
|
fn simple() {
|
|
let mut rt = CurrentThreadRuntime::new().unwrap();
|
|
let signal =
|
|
run_with_timeout(&mut rt, Signal::new(libc::SIGUSR1)).expect("failed to create signal");
|
|
|
|
send_signal(libc::SIGUSR1);
|
|
|
|
run_with_timeout(&mut rt, signal.into_future())
|
|
.ok()
|
|
.expect("failed to get signal");
|
|
}
|