From: Ewan Chou Date: Mon, 1 Apr 2013 11:36:41 +0000 (+1100) Subject: testing: report test as failed if the test panics. X-Git-Tag: go1.1rc2~244 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=174a17e3c6cee14b575c1871c6ce35c1c0806b45;p=gostls13.git testing: report test as failed if the test panics. Fixes #5149. R=golang-dev, dave, minux.ma CC=golang-dev https://golang.org/cl/8136043 --- diff --git a/src/pkg/testing/testing.go b/src/pkg/testing/testing.go index 86cd46c291..d0c759e292 100644 --- a/src/pkg/testing/testing.go +++ b/src/pkg/testing/testing.go @@ -337,6 +337,7 @@ func tRunner(t *T, test *InternalTest) { t.duration = time.Now().Sub(t.start) // If the test panicked, print any test output before dying. if err := recover(); err != nil { + t.Fail() t.report() panic(err) }