]> git.lizzy.rs Git - rust.git/blob - tests/ui/command/issue-10626.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / command / issue-10626.rs
1 // run-pass
2 // ignore-emscripten no processes
3 // ignore-sgx no processes
4
5 // Make sure that if a process doesn't have its stdio/stderr descriptors set up
6 // that we don't die in a large ball of fire
7
8 use std::env;
9 use std::process::{Command, Stdio};
10
11 pub fn main () {
12     let args: Vec<String> = env::args().collect();
13     if args.len() > 1 && args[1] == "child" {
14         for _ in 0..1000 {
15             println!("hello?");
16         }
17         for _ in 0..1000 {
18             println!("hello?");
19         }
20         return;
21     }
22
23     let mut p = Command::new(&args[0]);
24     p.arg("child").stdout(Stdio::null()).stderr(Stdio::null());
25     println!("{:?}", p.spawn().unwrap().wait());
26 }