]> git.lizzy.rs Git - rust.git/blob - tests/run-pass-valgrind/exit-flushes.rs
Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
[rust.git] / tests / run-pass-valgrind / exit-flushes.rs
1 // ignore-emscripten
2 // ignore-sgx no processes
3 // ignore-macos this needs valgrind 3.11 or higher; see
4 // https://github.com/rust-lang/rust/pull/30365#issuecomment-165763679
5
6 use std::env;
7 use std::process::{exit, Command};
8
9 fn main() {
10     if env::args().len() > 1 {
11         print!("hello!");
12         exit(0);
13     } else {
14         let out = Command::new(env::args().next().unwrap()).arg("foo")
15                           .output().unwrap();
16         assert!(out.status.success());
17         assert_eq!(String::from_utf8(out.stdout).unwrap(), "hello!");
18         assert_eq!(String::from_utf8(out.stderr).unwrap(), "");
19     }
20 }