summaryrefslogtreecommitdiff
path: root/src/testing/run_example.go
Commit message (Collapse)AuthorAgeFilesLines
* all: go fmt std cmd (but revert vendor)Russ Cox2021-02-201-0/+1
| | | | | | | | | | | | | | | | Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/294430 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* testing: fail Example tests that invoke runtime.GoexitChangkun Ou2020-09-011-1/+3
| | | | | | | | | | | | | | | | | Previously, if an example test invoked runtime.Goexit, it would pass yet hang until a timeout, while regular tests that invoke runtime.Goexit do fail. This change removes that inconsistent behavior and makes such example tests fail, and panic with an indication of having invoked runtime.Goexit. Fixes #41084 Change-Id: I0ffa152204f2b1580f4d5d6961ba1ce6b13fc022 Reviewed-on: https://go-review.googlesource.com/c/go/+/251857 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* testing: enable examples on js/wasm with non os.Pipe runExampleEmmanuel T Odeke2019-03-111-0/+64
os.Pipe is not implemented on wasm/js so for that purpose use a temporary file for js/wasm. This change creates two versions of runExample: * runExample verbatim that still uses os.Pipe for non js/wasm * runExample that uses a temporary file Also added a TODO to re-unify these function versions back into example.go wasm/js gets an os.Pipe implementation. Change-Id: I9f418a49b2c397e1667724c7442b7bbe8942225e Reviewed-on: https://go-review.googlesource.com/c/go/+/165357 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>