From: Andrew Gerrand Date: Tue, 24 Jun 2014 22:22:22 +0000 (+1000) Subject: cmd/go: build test files containing non-runnable examples X-Git-Tag: go1.4beta1~1225 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=eb4c3455de0ae2383038b5756e8948ca2516f090;p=gostls13.git cmd/go: build test files containing non-runnable examples Even if we can't run them, we should at least check that they compile. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/107320046 --- diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index 5935c98db9..ac32181118 100644 --- a/src/cmd/go/test.go +++ b/src/cmd/go/test.go @@ -1177,12 +1177,12 @@ func (t *testFuncs) load(filename, pkg string, seen *bool) error { ex := doc.Examples(f) sort.Sort(byOrder(ex)) for _, e := range ex { + *seen = true // Build the file even if the example is not runnable. if e.Output == "" && !e.EmptyOutput { // Don't run examples with no output. continue } t.Examples = append(t.Examples, testFunc{pkg, "Example" + e.Name, e.Output}) - *seen = true } return nil }