aboutsummaryrefslogtreecommitdiff
path: root/go/patch/go0.patch
diff options
context:
space:
mode:
Diffstat (limited to 'go/patch/go0.patch')
-rw-r--r--go/patch/go0.patch40
1 files changed, 26 insertions, 14 deletions
diff --git a/go/patch/go0.patch b/go/patch/go0.patch
index 27e1451e..c539865e 100644
--- a/go/patch/go0.patch
+++ b/go/patch/go0.patch
@@ -2,26 +2,33 @@ testenv: look for "go" executable in path.
--- src/go/build/deps_test.go
+++ src/go/build/deps_test.go
-@@ -168,7 +168,7 @@ var pkgDeps = map[string][]string{
- "testing": {"L2", "flag", "fmt", "os", "runtime/debug", "runtime/pprof", "runtime/trace", "time"},
+@@ -182,17 +182,17 @@ var pkgDeps = map[string][]string{
+ "runtime/debug": {"L2", "fmt", "io/ioutil", "os", "time"},
+ "runtime/pprof": {"L2", "compress/gzip", "context", "encoding/binary", "fmt", "io/ioutil", "os", "text/tabwriter", "time"},
+ "runtime/trace": {"L0"},
+ "text/tabwriter": {"L2"},
+
+ "testing": {"L2", "flag", "fmt", "internal/race", "os", "runtime/debug", "runtime/pprof", "runtime/trace", "time"},
"testing/iotest": {"L2", "log"},
- "testing/quick": {"L2", "flag", "fmt", "reflect"},
-- "internal/testenv": {"L2", "os", "testing"},
-+ "internal/testenv": {"L2", "os", "os/exec", "testing"},
+ "testing/quick": {"L2", "flag", "fmt", "reflect", "time"},
+- "internal/testenv": {"L2", "OS", "flag", "testing", "syscall"},
++ "internal/testenv": {"L2", "OS", "os/exec", "flag", "testing", "syscall"},
// L4 is defined as L3+fmt+log+time, because in general once
// you're using L3 packages, use of fmt, log, or time is not a big deal.
+ "L4": {
+ "L3",
+ "fmt",
+ "log",
+ "time",
--- src/internal/testenv/testenv.go
+++ src/internal/testenv/testenv.go
-@@ -12,6 +12,7 @@ package testenv
-
- import (
- "os"
-+ "os/exec"
- "runtime"
- "strings"
- "testing"
-@@ -36,6 +37,9 @@ func HasGoBuild() bool {
+@@ -43,16 +43,19 @@ func HasGoBuild() bool {
+ switch runtime.GOOS {
+ case "android", "nacl":
+ return false
+ case "darwin":
+ if strings.HasPrefix(runtime.GOARCH, "arm") {
return false
}
}
@@ -31,3 +38,8 @@ testenv: look for "go" executable in path.
return true
}
+ // MustHaveGoBuild checks that the current system can build programs with ``go build''
+ // and then run them with os.StartProcess or exec.Command.
+ // If not, MustHaveGoBuild calls t.Skip with an explanation.
+ func MustHaveGoBuild(t testing.TB) {
+ if os.Getenv("GO_GCFLAGS") != "" {