From: Andrew Gerrand Date: Fri, 18 Jan 2013 01:25:41 +0000 (+1100) Subject: testing: allow examples to pass (fix build) X-Git-Tag: go1.1rc2~1369 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e19cdc651cfdf2d3aa847f9700df639ddc8af591;p=gostls13.git testing: allow examples to pass (fix build) R=golang-dev CC=golang-dev https://golang.org/cl/7132050 --- diff --git a/src/pkg/testing/example.go b/src/pkg/testing/example.go index 4aec4830e1..828c2d3eda 100644 --- a/src/pkg/testing/example.go +++ b/src/pkg/testing/example.go @@ -67,6 +67,7 @@ func runExample(eg InternalExample) (ok bool) { }() start := time.Now() + ok = true // Clean up in a deferred call so we can recover if the example panics. defer func() { @@ -84,6 +85,7 @@ func runExample(eg InternalExample) (ok bool) { } if fail != "" || err != nil { fmt.Printf("--- FAIL: %s (%v)\n%s", eg.Name, d, fail) + ok = false } else if *chatty { fmt.Printf("--- PASS: %s (%v)\n", eg.Name, d) }