]> Cypherpunks repositories - gostls13.git/commitdiff
testing: report test as failed if the test panics.
authorEwan Chou <coocood@gmail.com>
Mon, 1 Apr 2013 11:36:41 +0000 (22:36 +1100)
committerDave Cheney <dave@cheney.net>
Mon, 1 Apr 2013 11:36:41 +0000 (22:36 +1100)
Fixes #5149.

R=golang-dev, dave, minux.ma
CC=golang-dev
https://golang.org/cl/8136043

src/pkg/testing/testing.go

index 86cd46c291873680bac49b0421e08d3f082f716d..d0c759e29260e95876eccb71690c54a7b0018315 100644 (file)
@@ -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)
                }