}
}
+func TestTestRaceInstall(t *testing.T) {
+ if !canRace {
+ t.Skip("no race detector")
+ }
+
+ tg := testgo(t)
+ defer tg.cleanup()
+ tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
+
+ tg.tempDir("pkg")
+ pkgdir := tg.path("pkg")
+ tg.run("install", "-race", "-pkgdir="+pkgdir, "std")
+ tg.run("test", "-race", "-pkgdir="+pkgdir, "-i", "-v", "empty/pkg")
+ if tg.getStderr() != "" {
+ t.Error("go test -i -race: rebuilds cached packages")
+ }
+}
+
func TestBuildDryRunWithCgo(t *testing.T) {
if !canCgo {
t.Skip("skipping because cgo not enabled")