1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // ignore-cloudabi no process support
12 // ignore-emscripten no threads support
14 use std
::{env, fmt, process, sync, thread}
;
17 impl fmt
::Debug
for SlowFmt
{
18 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
26 println
!("{:?}{:?}{:?}{:?}{:?}", x
, x
, x
, x
, x
);
30 if env
::args().count() == 2 {
31 let barrier
= sync
::Arc
::new(sync
::Barrier
::new(2));
32 let tbarrier
= barrier
.clone();
33 let t
= thread
::spawn(move || {
41 let this
= env
::args().next().unwrap();
42 let output
= process
::Command
::new(this
).arg("-").output().unwrap();
43 for line
in String
::from_utf8(output
.stdout
).unwrap().lines() {
44 match line
.chars().next().unwrap() {
45 '
1'
=> assert_eq
!(line
, "11111"),
46 '
2'
=> assert_eq
!(line
, "22222"),
47 chr
=> panic
!("unexpected character {:?}", chr
)