about summary refs log tree commit diff
path: root/src/test/ui/command
diff options
context:
space:
mode:
authorCaio <c410.f3r@gmail.com>2023-01-04 16:44:30 -0300
committerCaio <c410.f3r@gmail.com>2023-01-04 16:44:30 -0300
commit7ffcedf6659d30c4a076d89b2586b385ad2f2d16 (patch)
treea353326a3626b1f89d2c8a205b5cfc185c489495 /src/test/ui/command
parentb7cdb635c4b973572307ad288466fba64533369c (diff)
downloadrust-7ffcedf6659d30c4a076d89b2586b385ad2f2d16.tar.gz
rust-7ffcedf6659d30c4a076d89b2586b385ad2f2d16.zip
Move tests
Diffstat (limited to 'src/test/ui/command')
-rw-r--r--src/test/ui/command/issue-10626.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/command/issue-10626.rs b/src/test/ui/command/issue-10626.rs
new file mode 100644
index 00000000000..696a2dd1657
--- /dev/null
+++ b/src/test/ui/command/issue-10626.rs
@@ -0,0 +1,26 @@
+// run-pass
+// ignore-emscripten no processes
+// ignore-sgx no processes
+
+// Make sure that if a process doesn't have its stdio/stderr descriptors set up
+// that we don't die in a large ball of fire
+
+use std::env;
+use std::process::{Command, Stdio};
+
+pub fn main () {
+    let args: Vec<String> = env::args().collect();
+    if args.len() > 1 && args[1] == "child" {
+        for _ in 0..1000 {
+            println!("hello?");
+        }
+        for _ in 0..1000 {
+            println!("hello?");
+        }
+        return;
+    }
+
+    let mut p = Command::new(&args[0]);
+    p.arg("child").stdout(Stdio::null()).stderr(Stdio::null());
+    println!("{:?}", p.spawn().unwrap().wait());
+}