mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-12 00:00:12 +02:00
* Cargo runs each integration-style-test in its own process. Since the tests use global data structures specific to the process, we should run them in an isolated manner to avoid having cross-test interactions * Fixes alexcrichton/tokio-signal#39
21 lines
460 B
Rust
21 lines
460 B
Rust
#![cfg(unix)]
|
|
|
|
extern crate futures;
|
|
extern crate libc;
|
|
extern crate tokio_core;
|
|
extern crate tokio_signal;
|
|
|
|
use futures::stream::Stream;
|
|
use tokio_core::reactor::Core;
|
|
use tokio_signal::unix::Signal;
|
|
|
|
#[test]
|
|
fn simple() {
|
|
let mut lp = Core::new().unwrap();
|
|
let signal = lp.run(Signal::new(libc::SIGUSR1)).unwrap();
|
|
unsafe {
|
|
assert_eq!(libc::kill(libc::getpid(), libc::SIGUSR1), 0);
|
|
}
|
|
lp.run(signal.into_future()).ok().unwrap();
|
|
}
|