diff options
author | Andrew Gerrand <adg@golang.org> | 2014-06-25 08:22:22 +1000 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2014-06-25 08:22:22 +1000 |
commit | 78c8414297c5171e60ed3cddac9901e9c7d1d6f4 (patch) | |
tree | ab0af52f261c3ea837dd64f5d625b1d93ab89b3d /src/cmd/go | |
parent | b772643cf5807cafb4b3d23abc367c9936367408 (diff) | |
download | go-78c8414297c5171e60ed3cddac9901e9c7d1d6f4.tar.gz |
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://codereview.appspot.com/107320046
Diffstat (limited to 'src/cmd/go')
-rw-r--r-- | src/cmd/go/test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index 5935c98db..ac3218111 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 } |