]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/go/go_test.go
cmd/go: don't install most GOROOT .a files in pkg
[gostls13.git] / src / cmd / go / go_test.go
index bd1de7d1b9b183a4ae216c5d91567a3549da8d6e..f5f583fbeacfd9a331ea2747202cfe5a76bd7f18 100644 (file)
@@ -1803,16 +1803,23 @@ func TestImportLocal(t *testing.T) {
 
 func TestGoInstallPkgdir(t *testing.T) {
        skipIfGccgo(t, "gccgo has no standard packages")
+       if !canCgo {
+               // Only the stdlib packages that use cgo have install
+               // targets, (we're using net below) so cgo is required
+               // for the install.
+               t.Skip("skipping because cgo not enabled")
+       }
        tooSlow(t)
 
        tg := testgo(t)
        tg.parallel()
+       tg.setenv("GODEBUG", "installgoroot=all")
        defer tg.cleanup()
        tg.makeTempdir()
        pkg := tg.path(".")
-       tg.run("install", "-pkgdir", pkg, "sync")
-       tg.mustExist(filepath.Join(pkg, "sync.a"))
-       tg.mustNotExist(filepath.Join(pkg, "sync/atomic.a"))
+       tg.run("install", "-pkgdir", pkg, "net")
+       tg.mustExist(filepath.Join(pkg, "net.a"))
+       tg.mustNotExist(filepath.Join(pkg, "runtime/cgo.a"))
 }
 
 // For issue 14337.