]> Cypherpunks repositories - gostls13.git/commitdiff
testing: do not recover example's panic
authorShenghou Ma <minux.ma@gmail.com>
Thu, 19 Jan 2012 18:19:33 +0000 (10:19 -0800)
committerRob Pike <r@golang.org>
Thu, 19 Jan 2012 18:19:33 +0000 (10:19 -0800)
        So as to give out stack trace for panic in examples.
        This behavior also matches the tests'.
        Fixes #2691.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5554061

src/pkg/testing/example.go

index fdeda137e7614facde2b4a4ade14e67970610ade..7f8ff2d0541552ba1863e17f2717ccc30adfef5e 100644 (file)
@@ -25,13 +25,6 @@ func RunExamples(examples []InternalExample) (ok bool) {
        var eg InternalExample
 
        stdout, stderr := os.Stdout, os.Stderr
-       defer func() {
-               os.Stdout, os.Stderr = stdout, stderr
-               if e := recover(); e != nil {
-                       fmt.Printf("--- FAIL: %s\npanic: %v\n", eg.Name, e)
-                       os.Exit(1)
-               }
-       }()
 
        for _, eg = range examples {
                if *chatty {