diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-22 01:15:33 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-22 01:15:33 +0000 |
commit | 362133b5eb9024407b03e8095307f9d5d36154c2 (patch) | |
tree | 06f36bbef6fae78278f799194ad0df8ba2dabaa1 /libgo/go/testing | |
parent | 331a34f7832c3b58fd8488f49121a6af52433123 (diff) | |
download | gcc-362133b5eb9024407b03e8095307f9d5d36154c2.tar.gz |
libgo: Update to revision 15193:6fdc1974457c of master library.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194692 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/testing')
-rw-r--r-- | libgo/go/testing/example.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libgo/go/testing/example.go b/libgo/go/testing/example.go index 671c798760b..dc97255965e 100644 --- a/libgo/go/testing/example.go +++ b/libgo/go/testing/example.go @@ -24,7 +24,7 @@ func RunExamples(matchString func(pat, str string) (bool, error), examples []Int var eg InternalExample - stdout, stderr := os.Stdout, os.Stderr + stdout := os.Stdout for _, eg = range examples { matched, err := matchString(*match, eg.Name) @@ -39,19 +39,19 @@ func RunExamples(matchString func(pat, str string) (bool, error), examples []Int fmt.Printf("=== RUN: %s\n", eg.Name) } - // capture stdout and stderr + // capture stdout r, w, err := os.Pipe() if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } - os.Stdout, os.Stderr = w, w + os.Stdout = w outC := make(chan string) go func() { buf := new(bytes.Buffer) _, err := io.Copy(buf, r) if err != nil { - fmt.Fprintf(stderr, "testing: copying pipe: %v\n", err) + fmt.Fprintf(os.Stderr, "testing: copying pipe: %v\n", err) os.Exit(1) } outC <- buf.String() @@ -62,9 +62,9 @@ func RunExamples(matchString func(pat, str string) (bool, error), examples []Int eg.F() dt := time.Now().Sub(t0) - // close pipe, restore stdout/stderr, get output + // close pipe, restore stdout, get output w.Close() - os.Stdout, os.Stderr = stdout, stderr + os.Stdout = stdout out := <-outC // report any errors |