3 #![allow(unused_must_use)]
5 // ignore-cloudabi no process support
6 // ignore-emscripten no threads support
7 // ignore-sgx no processes
9 use std::{env, fmt, process, sync, thread};
12 impl fmt::Debug for SlowFmt {
13 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
21 println!("{:?}{:?}{:?}{:?}{:?}", x, x, x, x, x);
25 if env::args().count() == 2 {
26 let barrier = sync::Arc::new(sync::Barrier::new(2));
27 let tbarrier = barrier.clone();
28 let t = thread::spawn(move || {
36 let this = env::args().next().unwrap();
37 let output = process::Command::new(this).arg("-").output().unwrap();
38 for line in String::from_utf8(output.stdout).unwrap().lines() {
39 match line.chars().next().unwrap() {
40 '1' => assert_eq!(line, "11111"),
41 '2' => assert_eq!(line, "22222"),
42 chr => panic!("unexpected character {:?}", chr)