From 45ba6e2652119d507ad3c3d73f0602ef9cfd2e3e Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Sat, 5 May 2018 20:33:51 +0200 Subject: [PATCH] signal: Remove test that were accidentally included in the ctrl-c example --- examples/ctrl-c.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/examples/ctrl-c.rs b/examples/ctrl-c.rs index 1d3ce602d..df821a3f5 100644 --- a/examples/ctrl-c.rs +++ b/examples/ctrl-c.rs @@ -61,38 +61,3 @@ fn main() { println!("Stream ended, quiting the program."); } - -#[cfg(test)] -// `Child::kill` terminates the application instead of sending the equivalent to SIGKILL on windows -#[cfg(unix)] -mod tests { - use super::*; - - use std::env; - use std::path::Path; - use std::process::Command; - - #[test] - fn ctrl_c() { - let args = env::args().collect::>(); - let ctrl_c_child = "ctrl_c_child"; - if args.len() >= 3 && args.last().map(|s| &s[..]) == Some(ctrl_c_child) { - super::main(); - } else { - let ctrl_c_path = Path::new("target") - .join("debug") - .join("examples") - .join("ctrl-c"); - let mut child = Command::new(ctrl_c_path) - .args(&["ctrl_c", "--nocapture", ctrl_c_child]) - .spawn() - .unwrap(); - - for i in 0..STOP_AFTER { - println!("Kill {}", i); - child.kill().unwrap(); - } - child.wait().unwrap(); - } - } -}