]> Cypherpunks repositories - gostls13.git/commitdiff
testing: allow examples to pass (fix build)
authorAndrew Gerrand <adg@golang.org>
Fri, 18 Jan 2013 01:25:41 +0000 (12:25 +1100)
committerAndrew Gerrand <adg@golang.org>
Fri, 18 Jan 2013 01:25:41 +0000 (12:25 +1100)
R=golang-dev
CC=golang-dev
https://golang.org/cl/7132050

src/pkg/testing/example.go

index 4aec4830e1fb621f8b6f61d9f7830a03ec7367e9..828c2d3eda809e1fc940e36e35c5944857592fb6 100644 (file)
@@ -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)
                }