signal: Remove test that were accidentally included in the ctrl-c example

This commit is contained in:
Markus Westerlind 2018-05-05 20:33:51 +02:00 committed by Carl Lerche
parent e73b8a0cc9
commit 45ba6e2652

View File

@ -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::<Vec<_>>();
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();
}
}
}