]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: better error from TestGcSys when gc is disabled
authorRuss Cox <rsc@golang.org>
Thu, 21 Feb 2013 18:30:31 +0000 (13:30 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 21 Feb 2013 18:30:31 +0000 (13:30 -0500)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7390047

src/pkg/runtime/gc_test.go

index 283a6812e95f3d270920ff526cfffe45d50ecdd1..0215ff2cf435059eb3a8da7dcc042a5c6decad83 100644 (file)
@@ -5,11 +5,15 @@
 package runtime_test
 
 import (
+       "os"
        "runtime"
        "testing"
 )
 
 func TestGcSys(t *testing.T) {
+       if os.Getenv("GOGC") == "off" {
+               t.Fatalf("GOGC=off in environment; test cannot pass")
+       }
        defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
        memstats := new(runtime.MemStats)
        runtime.GC()