]> Cypherpunks repositories - gostls13.git/commitdiff
testing: use runtime/debug to format panics
authorRuss Cox <rsc@golang.org>
Mon, 13 Feb 2012 04:41:07 +0000 (23:41 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 13 Feb 2012 04:41:07 +0000 (23:41 -0500)
Sorry, Mercurial failed me.

TBR=r, dsymonds
CC=golang-dev
https://golang.org/cl/5649080

src/pkg/testing/testing.go

index 5e43f0f8e47c8c93ac8e6ad05684f76de57291ca..b60d5c1b0d4b553637f853e7e474bd6e1990f0f6 100644 (file)
@@ -248,12 +248,10 @@ func tRunner(t *T, test *InternalTest) {
        // a call to runtime.Goexit, record the duration and send
        // a signal saying that the test is done.
        defer func() {
-               if false {
-                       // Log and recover from panic instead of aborting binary.
-                       if err := recover(); err != nil {
-                               t.failed = true
-                               t.Logf("%s\n%s", err, debug.Stack())
-                       }
+               // Log and recover from panic instead of aborting binary.
+               if err := recover(); err != nil {
+                       t.failed = true
+                       t.Logf("%s\n%s", err, debug.Stack())
                }
 
                t.duration = time.Now().Sub(t.start)