mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
* Don't use tokio-core any more for tests. That one brings tokio from crates.io instead of the current workspace and two versions of that don't want to cooperate. * Guard unix-specific examples on windows. * Leave CI setup to top-level directory.
24 lines
609 B
Rust
24 lines
609 B
Rust
#![cfg(unix)]
|
|
|
|
extern crate libc;
|
|
|
|
pub mod support;
|
|
use support::*;
|
|
|
|
#[test]
|
|
fn drop_then_get_a_signal() {
|
|
let mut rt = CurrentThreadRuntime::new().unwrap();
|
|
let signal = run_with_timeout(&mut rt, Signal::new(libc::SIGUSR1))
|
|
.expect("failed to create first signal");
|
|
drop(signal);
|
|
|
|
send_signal(libc::SIGUSR1);
|
|
let signal = run_with_timeout(&mut rt, Signal::new(libc::SIGUSR1))
|
|
.expect("failed to create signal")
|
|
.into_future()
|
|
.map(|_| ())
|
|
.map_err(|(e, _)| panic!("{}", e));
|
|
|
|
run_with_timeout(&mut rt, signal).expect("failed to get signal");
|
|
}
|