diff options
Diffstat (limited to 'src/internal/testenv')
| -rw-r--r-- | src/internal/testenv/exec.go | 2 | ||||
| -rw-r--r-- | src/internal/testenv/testenv.go | 9 | ||||
| -rw-r--r-- | src/internal/testenv/testenv_notunix.go | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/internal/testenv/exec.go b/src/internal/testenv/exec.go index 77de59c70a..ec2f2e295c 100644 --- a/src/internal/testenv/exec.go +++ b/src/internal/testenv/exec.go @@ -20,7 +20,7 @@ import ( // using os.StartProcess or (more commonly) exec.Command. func HasExec() bool { switch runtime.GOOS { - case "js", "ios": + case "wasip1", "js", "ios": return false } return true diff --git a/src/internal/testenv/testenv.go b/src/internal/testenv/testenv.go index 565230e24c..9a649e037c 100644 --- a/src/internal/testenv/testenv.go +++ b/src/internal/testenv/testenv.go @@ -46,7 +46,7 @@ func HasGoBuild() bool { return false } switch runtime.GOOS { - case "android", "js", "ios": + case "android", "js", "ios", "wasip1": return false } return true @@ -80,6 +80,7 @@ func MustHaveGoRun(t testing.TB) { // HasParallelism reports whether the current system can execute multiple // threads in parallel. +// There is a copy of this function in cmd/dist/test.go. func HasParallelism() bool { switch runtime.GOOS { case "js", "wasip1": @@ -257,14 +258,14 @@ func HasSrc() bool { // HasExternalNetwork reports whether the current system can use // external (non-localhost) networks. func HasExternalNetwork() bool { - return !testing.Short() && runtime.GOOS != "js" + return !testing.Short() && runtime.GOOS != "js" && runtime.GOOS != "wasip1" } // MustHaveExternalNetwork checks that the current system can use // external (non-localhost) networks. // If not, MustHaveExternalNetwork calls t.Skip with an explanation. func MustHaveExternalNetwork(t testing.TB) { - if runtime.GOOS == "js" { + if runtime.GOOS == "js" || runtime.GOOS == "wasip1" { t.Skipf("skipping test: no external network on %s", runtime.GOOS) } if testing.Short() { @@ -372,7 +373,7 @@ func SkipFlakyNet(t testing.TB) { // CPUIsSlow reports whether the CPU running the test is suspected to be slow. func CPUIsSlow() bool { switch runtime.GOARCH { - case "arm", "mips", "mipsle", "mips64", "mips64le": + case "arm", "mips", "mipsle", "mips64", "mips64le", "wasm": return true } return false diff --git a/src/internal/testenv/testenv_notunix.go b/src/internal/testenv/testenv_notunix.go index 9313c7c827..31abe8d092 100644 --- a/src/internal/testenv/testenv_notunix.go +++ b/src/internal/testenv/testenv_notunix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build windows || plan9 || (js && wasm) +//go:build windows || plan9 || (js && wasm) || wasip1 package testenv |
