aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.go
diff options
context:
space:
mode:
authorMarcel van Lohuizen <mpvl@golang.org>2016-01-29 17:14:51 +0100
committerMarcel van Lohuizen <mpvl@golang.org>2016-03-22 14:56:15 +0000
commit23a756d856dabd86e3f83480f31c291cbcd6464a (patch)
tree7be25347c8fb9ef4979d5af09b3f0bb1606a5d22 /src/testing/testing.go
parent00a2a94c1eab027bc1ac5bbb9f30329dec14cf87 (diff)
downloadgo-23a756d856dabd86e3f83480f31c291cbcd6464a.tar.xz
testing: expose subtest and subbenchmark functionality
Fixes #12166 Change-Id: Ie62cba2c39beb5732447ba3688c93c08ef12abb5 Reviewed-on: https://go-review.googlesource.com/18898 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Diffstat (limited to 'src/testing/testing.go')
-rw-r--r--src/testing/testing.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go
index 5c6f16e41a..f9bb43b618 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -548,9 +548,9 @@ 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 runs f as a subtest of t called name. It reports whether f succeeded.
// Run will block until all its parallel subtests have completed.
-func (t *T) run(name string, f func(t *T)) bool {
+func (t *T) Run(name string, f func(t *T)) bool {
testName, ok := t.context.match.fullName(&t.common, name)
if !ok {
return true
@@ -721,7 +721,7 @@ func RunTests(matchString func(pat, str string) (bool, error), tests []InternalT
}
tRunner(t, func(t *T) {
for _, test := range tests {
- t.run(test.Name, test.F)
+ t.Run(test.Name, test.F)
}
// Run catching the signal rather than the tRunner as a separate
// goroutine to avoid adding a goroutine during the sequential