From: Russ Cox Date: Mon, 13 Feb 2012 04:41:07 +0000 (-0500) Subject: testing: use runtime/debug to format panics X-Git-Tag: weekly.2012-02-14~91 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8bcfad269e0326004dce1d9bd77e6a4f6d0468e4;p=gostls13.git testing: use runtime/debug to format panics Sorry, Mercurial failed me. TBR=r, dsymonds CC=golang-dev https://golang.org/cl/5649080 --- diff --git a/src/pkg/testing/testing.go b/src/pkg/testing/testing.go index 5e43f0f8e4..b60d5c1b0d 100644 --- a/src/pkg/testing/testing.go +++ b/src/pkg/testing/testing.go @@ -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)