From: Shenghou Ma Date: Wed, 15 Feb 2012 18:26:22 +0000 (-0500) Subject: cmd/go: go test -i correctly handle cgo packages X-Git-Tag: weekly.2012-02-22~223 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9c1f54c9ed67b77385940c58fb15af18166d4840;p=gostls13.git cmd/go: go test -i correctly handle cgo packages Previous CL (5674043) omit the case where runtime/cgo itself is out-of-date. Fixes #2936 (again). R=rsc CC=golang-dev https://golang.org/cl/5674048 --- diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index a291262b3f..8c88ea0b02 100644 --- a/src/cmd/go/test.go +++ b/src/cmd/go/test.go @@ -15,6 +15,7 @@ import ( "os/exec" "path" "path/filepath" + "runtime" "sort" "strings" "text/template" @@ -273,8 +274,15 @@ func runTest(cmd *Command, args []string) { } } + // translate C to runtime/cgo + if deps["C"] { + delete(deps, "C") + deps["runtime/cgo"] = true + if buildContext.GOOS == runtime.GOOS && buildContext.GOARCH == runtime.GOARCH { + deps["cmd/cgo"] = true + } + } // Ignore pseudo-packages. - delete(deps, "C") delete(deps, "unsafe") all := []string{}