aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.go
diff options
context:
space:
mode:
authorMarcel van Lohuizen <mpvl@golang.org>2017-05-30 12:11:04 +0200
committerMarcel van Lohuizen <mpvl@golang.org>2017-05-30 16:28:16 +0000
commitd10549fb5763d33667ab02c0713c22c14f90078c (patch)
tree922ad1d11e1e7bd3b1be76018c816afd52cb65a8 /src/testing/testing.go
parent4c86f7bd498453ce452f18b6fa1396bb12e6ac66 (diff)
downloadgo-d10549fb5763d33667ab02c0713c22c14f90078c.tar.xz
testing: clarify that subtests are run as goroutines
Fixes #20394 Change-Id: Iabb2a53fd1ddb783e7fb5b60ced8482c2e2569c4 Reviewed-on: https://go-review.googlesource.com/44377 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/testing/testing.go')
-rw-r--r--src/testing/testing.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go
index aa620f42b8..7754d4e61f 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -748,11 +748,12 @@ func tRunner(t *T, fn func(t *T)) {
t.finished = true
}
-// Run runs f as a subtest of t called name. It reports whether f succeeded.
-// Run will block until all its parallel subtests have completed.
+// Run runs f as a subtest of t called name. It reports whether f succeeded. Run
+// runs f in a separate goroutine and will block until all its parallel subtests
+// have completed.
//
-// Run may be called simultaneously from multiple goroutines, but all such
-// calls must happen before the outer test function for t returns.
+// Run may be called simultaneously from multiple goroutines, but all such calls
+// must happen before the outer test function for t returns.
func (t *T) Run(name string, f func(t *T)) bool {
atomic.StoreInt32(&t.hasSub, 1)
testName, ok := t.context.match.fullName(&t.common, name)