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