]> Cypherpunks repositories - gostls13.git/commitdiff
all: shorten some of the longer tests
authorRuss Cox <rsc@golang.org>
Sat, 18 Feb 2012 21:24:23 +0000 (16:24 -0500)
committerRuss Cox <rsc@golang.org>
Sat, 18 Feb 2012 21:24:23 +0000 (16:24 -0500)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5675092

src/pkg/compress/flate/deflate_test.go
src/pkg/image/ycbcr_test.go
src/pkg/math/big/nat_test.go
src/pkg/math/rand/rand_test.go
src/pkg/old/netchan/netchan_test.go

index a76e2d930f60694adf9dc745f3a34dc3c627d125..543c5950586ce3e31a49bdf6b1cc4fab8499e605 100644 (file)
@@ -306,6 +306,9 @@ func TestDeflateInflateString(t *testing.T) {
                        t.Error(err)
                }
                testToFromWithLimit(t, gold, test.label, test.limit)
+               if testing.Short() {
+                       break
+               }
        }
 }
 
@@ -363,6 +366,10 @@ func TestWriterDict(t *testing.T) {
 
 // See http://code.google.com/p/go/issues/detail?id=2508
 func TestRegression2508(t *testing.T) {
+       if testing.Short() {
+               t.Logf("test disabled with -short")
+               return
+       }
        w, err := NewWriter(ioutil.Discard, 1)
        if err != nil {
                t.Fatalf("NewWriter: %v", err)
index 7852b31ded61194ba37938498dc4943d3eb18b26..5fa95be3e07fd09bf4b964c724faaa1d755c05a4 100644 (file)
@@ -49,6 +49,9 @@ func TestYCbCr(t *testing.T) {
                                testYCbCr(t, r, subsampleRatio, delta)
                        }
                }
+               if testing.Short() {
+                       break
+               }
        }
 }
 
index 25e39273c0c8b48313cd5b394b9984645cc49183..7f3f76dc36f6ce97bbe98fde928a9edf17d59188 100644 (file)
@@ -512,6 +512,9 @@ func TestStringPowers(t *testing.T) {
                                t.Errorf("failed at %d ** %d in base %d: %s != %s", b, p, b, xs, xs2)
                        }
                }
+               if b >= 3 && testing.Short() {
+                       break
+               }
        }
 }
 
index 0ba8f98c4965ba493511c213783eff819d4687fe..bbd44e3f8b10657bdb8e6e4a54f009e14ada5901 100644 (file)
@@ -141,6 +141,9 @@ func TestNonStandardNormalValues(t *testing.T) {
                for m := 0.5; m < mmax; m *= 2 {
                        for _, seed := range testSeeds {
                                testNormalDistribution(t, numTestSamples, m, sd, seed)
+                               if testing.Short() {
+                                       break
+                               }
                        }
                }
        }
@@ -191,6 +194,9 @@ func TestNonStandardExponentialValues(t *testing.T) {
        for rate := 0.05; rate < 10; rate *= 2 {
                for _, seed := range testSeeds {
                        testExponentialDistribution(t, numTestSamples, rate, seed)
+                       if testing.Short() {
+                               break
+                       }
                }
        }
 }
index 53f0f78776566958c71ab3994cf5124603cf8e6b..9a7c076d59c92303caa0001ba56288ef263ca7d8 100644 (file)
@@ -291,6 +291,10 @@ func exportLoopback(exp *Exporter, t *testing.T) {
 // This test checks that channel operations can proceed
 // even when other concurrent operations are blocked.
 func TestIndependentSends(t *testing.T) {
+       if testing.Short() {
+               t.Logf("disabled test during -short")
+               return
+       }
        exp, imp := pair(t)
 
        exportLoopback(exp, t)
@@ -378,6 +382,10 @@ const flowCount = 100
 
 // test flow control from exporter to importer.
 func TestExportFlowControl(t *testing.T) {
+       if testing.Short() {
+               t.Logf("disabled test during -short")
+               return
+       }
        exp, imp := pair(t)
 
        sendDone := make(chan bool, 1)
@@ -394,6 +402,10 @@ func TestExportFlowControl(t *testing.T) {
 
 // test flow control from importer to exporter.
 func TestImportFlowControl(t *testing.T) {
+       if testing.Short() {
+               t.Logf("disabled test during -short")
+               return
+       }
        exp, imp := pair(t)
 
        ch := make(chan int)