]> Cypherpunks repositories - gostls13.git/commitdiff
testing: shorten go test -short testing
authorRuss Cox <rsc@golang.org>
Wed, 15 May 2019 19:15:33 +0000 (15:15 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 16 May 2019 03:25:08 +0000 (03:25 +0000)
This cuts the time for 'go test -short testing' from 0.9s to < 0.1s.

Change-Id: Ib8402f80239e1e96ea5221dfd5cd0db08170d85b
Reviewed-on: https://go-review.googlesource.com/c/go/+/177420
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/testing/benchmark_test.go
src/testing/sub_test.go

index a872d6798b592500748ed0423efa2d393a1142c3..1434c2613f138cc5ce00b0830f15a4ac6b13dc51 100644 (file)
@@ -68,6 +68,9 @@ func TestResultString(t *testing.T) {
 }
 
 func TestRunParallel(t *testing.T) {
+       if testing.Short() {
+               t.Skip("skipping in short mode")
+       }
        testing.Benchmark(func(b *testing.B) {
                procs := uint32(0)
                iters := uint64(0)
index 884b0a3b126cd2aeb6e5d2dc98a00f16c9a150c7..cc5dd2f3cfbfc2144cc15eddb32e338cb1528da7 100644 (file)
@@ -756,6 +756,9 @@ func TestLogAfterComplete(t *T) {
 }
 
 func TestBenchmark(t *T) {
+       if Short() {
+               t.Skip("skipping in short mode")
+       }
        res := Benchmark(func(b *B) {
                for i := 0; i < 5; i++ {
                        b.Run("", func(b *B) {