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