diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/archive/zip/zip_test.go | 4 | ||||
| -rw-r--r-- | src/cmd/go/go_test.go | 2 | ||||
| -rw-r--r-- | src/cmd/go/internal/base/signal_unix.go | 2 | ||||
| -rw-r--r-- | src/cmd/vendor/github.com/google/pprof/internal/driver/fetch_test.go | 2 | ||||
| -rw-r--r-- | src/cmd/vendor/github.com/google/pprof/internal/driver/webui_test.go | 2 | ||||
| -rw-r--r-- | src/debug/elf/file_test.go | 2 | ||||
| -rw-r--r-- | src/encoding/gob/encoder_test.go | 4 | ||||
| -rw-r--r-- | src/internal/testenv/testenv.go | 9 | ||||
| -rw-r--r-- | src/log/syslog/syslog_test.go | 2 | ||||
| -rw-r--r-- | src/runtime/chanbarrier_test.go | 2 | ||||
| -rw-r--r-- | src/runtime/crash_nonunix_test.go | 2 | ||||
| -rw-r--r-- | src/runtime/gc_test.go | 4 | ||||
| -rw-r--r-- | src/runtime/hash_test.go | 15 | ||||
| -rw-r--r-- | src/runtime/pprof/pprof_test.go | 2 | ||||
| -rw-r--r-- | src/runtime/proc_test.go | 26 | ||||
| -rw-r--r-- | src/runtime/runtime_test.go | 5 | ||||
| -rw-r--r-- | src/runtime/rwmutex_test.go | 3 | ||||
| -rw-r--r-- | src/runtime/stack_test.go | 4 | ||||
| -rw-r--r-- | src/syscall/syscall_test.go | 4 | ||||
| -rw-r--r-- | src/text/template/exec.go | 9 |
20 files changed, 89 insertions, 16 deletions
diff --git a/src/archive/zip/zip_test.go b/src/archive/zip/zip_test.go index 5adb87d5e3..50218a2bbd 100644 --- a/src/archive/zip/zip_test.go +++ b/src/archive/zip/zip_test.go @@ -15,6 +15,7 @@ import ( "internal/testenv" "io" "io/ioutil" + "runtime" "sort" "strings" "testing" @@ -461,6 +462,9 @@ func suffixIsZip64(t *testing.T, zip sizedReaderAt) bool { // Zip64 is required if the total size of the records is uint32max. func TestZip64LargeDirectory(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("too slow on wasm") + } if testing.Short() { t.Skip("skipping in short mode") } diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index f534657055..19e4116eb3 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -48,7 +48,7 @@ func tooSlow(t *testing.T) { func init() { switch runtime.GOOS { - case "android", "nacl": + case "android", "js", "nacl": canRun = false case "darwin": switch runtime.GOARCH { diff --git a/src/cmd/go/internal/base/signal_unix.go b/src/cmd/go/internal/base/signal_unix.go index 4ca3da9922..38490b571b 100644 --- a/src/cmd/go/internal/base/signal_unix.go +++ b/src/cmd/go/internal/base/signal_unix.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. -// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris +// +build darwin dragonfly freebsd js linux nacl netbsd openbsd solaris package base diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch_test.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch_test.go index f15328bfae..afb135b7cd 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch_test.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch_test.go @@ -361,7 +361,7 @@ func closedError() string { } func TestHttpsInsecure(t *testing.T) { - if runtime.GOOS == "nacl" { + if runtime.GOOS == "nacl" || runtime.GOOS == "js" { t.Skip("test assumes tcp available") } saveHome := os.Getenv(homeEnv()) diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/webui_test.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/webui_test.go index 7e061699ce..328f1596d9 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/driver/webui_test.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/webui_test.go @@ -237,7 +237,7 @@ func makeFakeProfile() *profile.Profile { } func TestGetHostAndPort(t *testing.T) { - if runtime.GOOS == "nacl" { + if runtime.GOOS == "nacl" || runtime.GOOS == "js" { t.Skip("test assumes tcp available") } diff --git a/src/debug/elf/file_test.go b/src/debug/elf/file_test.go index 880b66e797..11d8992b71 100644 --- a/src/debug/elf/file_test.go +++ b/src/debug/elf/file_test.go @@ -784,7 +784,7 @@ func TestCompressedSection(t *testing.T) { func TestNoSectionOverlaps(t *testing.T) { // Ensure cmd/link outputs sections without overlaps. switch runtime.GOOS { - case "android", "darwin", "nacl", "plan9", "windows": + case "android", "darwin", "js", "nacl", "plan9", "windows": t.Skipf("cmd/link doesn't produce ELF binaries on %s", runtime.GOOS) } _ = net.ResolveIPAddr // force dynamic linkage diff --git a/src/encoding/gob/encoder_test.go b/src/encoding/gob/encoder_test.go index a1ca252ccd..a41fc9e889 100644 --- a/src/encoding/gob/encoder_test.go +++ b/src/encoding/gob/encoder_test.go @@ -10,6 +10,7 @@ import ( "fmt" "io/ioutil" "reflect" + "runtime" "strings" "testing" ) @@ -1130,6 +1131,9 @@ func TestBadData(t *testing.T) { // TestHugeWriteFails tests that enormous messages trigger an error. func TestHugeWriteFails(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("out of memory on wasm") + } if testing.Short() { // Requires allocating a monster, so don't do this from all.bash. t.Skip("skipping huge allocation in short mode") diff --git a/src/internal/testenv/testenv.go b/src/internal/testenv/testenv.go index b3c16a8e87..8f69fe0da5 100644 --- a/src/internal/testenv/testenv.go +++ b/src/internal/testenv/testenv.go @@ -41,7 +41,7 @@ func HasGoBuild() bool { return false } switch runtime.GOOS { - case "android", "nacl": + case "android", "nacl", "js": return false case "darwin": if strings.HasPrefix(runtime.GOARCH, "arm") { @@ -114,7 +114,7 @@ func GoTool() (string, error) { // using os.StartProcess or (more commonly) exec.Command. func HasExec() bool { switch runtime.GOOS { - case "nacl": + case "nacl", "js": return false case "darwin": if strings.HasPrefix(runtime.GOARCH, "arm") { @@ -149,13 +149,16 @@ func MustHaveExec(t testing.TB) { // HasExternalNetwork reports whether the current system can use // external (non-localhost) networks. func HasExternalNetwork() bool { - return !testing.Short() + return !testing.Short() && runtime.GOOS != "nacl" && runtime.GOOS != "js" } // 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 == "nacl" || runtime.GOOS == "js" { + t.Skipf("skipping test: no external network on %s", runtime.GOOS) + } if testing.Short() { t.Skipf("skipping test: no external network in -short mode") } diff --git a/src/log/syslog/syslog_test.go b/src/log/syslog/syslog_test.go index 1263be6d78..6da3edd555 100644 --- a/src/log/syslog/syslog_test.go +++ b/src/log/syslog/syslog_test.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. -// +build !windows,!nacl,!plan9 +// +build !windows,!nacl,!plan9,!js package syslog diff --git a/src/runtime/chanbarrier_test.go b/src/runtime/chanbarrier_test.go index b6029fb044..d4795748bf 100644 --- a/src/runtime/chanbarrier_test.go +++ b/src/runtime/chanbarrier_test.go @@ -57,7 +57,7 @@ func testChanSendBarrier(useSelect bool) { var globalMu sync.Mutex outer := 100 inner := 100000 - if testing.Short() { + if testing.Short() || runtime.GOARCH == "wasm" { outer = 10 inner = 1000 } diff --git a/src/runtime/crash_nonunix_test.go b/src/runtime/crash_nonunix_test.go index 2ce995c069..bf349a5d89 100644 --- a/src/runtime/crash_nonunix_test.go +++ b/src/runtime/crash_nonunix_test.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. -// +build windows plan9 nacl +// +build windows plan9 nacl js,wasm package runtime_test diff --git a/src/runtime/gc_test.go b/src/runtime/gc_test.go index 561061e3d8..d683d89fe4 100644 --- a/src/runtime/gc_test.go +++ b/src/runtime/gc_test.go @@ -155,6 +155,10 @@ func TestHugeGCInfo(t *testing.T) { } func TestPeriodicGC(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("no sysmon on wasm yet") + } + // Make sure we're not in the middle of a GC. runtime.GC() diff --git a/src/runtime/hash_test.go b/src/runtime/hash_test.go index 1400579cda..7b8ebc4f3c 100644 --- a/src/runtime/hash_test.go +++ b/src/runtime/hash_test.go @@ -161,6 +161,9 @@ func TestSmhasherZeros(t *testing.T) { // Strings with up to two nonzero bytes all have distinct hashes. func TestSmhasherTwoNonzero(t *testing.T) { + if GOARCH == "wasm" { + t.Skip("Too slow on wasm") + } if testing.Short() { t.Skip("Skipping in short mode") } @@ -229,6 +232,9 @@ func TestSmhasherCyclic(t *testing.T) { // Test strings with only a few bits set func TestSmhasherSparse(t *testing.T) { + if GOARCH == "wasm" { + t.Skip("Too slow on wasm") + } if testing.Short() { t.Skip("Skipping in short mode") } @@ -264,6 +270,9 @@ func setbits(h *HashSet, b []byte, i int, k int) { // Test all possible combinations of n blocks from the set s. // "permutation" is a bad name here, but it is what Smhasher uses. func TestSmhasherPermutation(t *testing.T) { + if GOARCH == "wasm" { + t.Skip("Too slow on wasm") + } if testing.Short() { t.Skip("Skipping in short mode") } @@ -433,6 +442,9 @@ func (k *IfaceKey) name() string { // Flipping a single bit of a key should flip each output bit with 50% probability. func TestSmhasherAvalanche(t *testing.T) { + if GOARCH == "wasm" { + t.Skip("Too slow on wasm") + } if testing.Short() { t.Skip("Skipping in short mode") } @@ -508,6 +520,9 @@ func TestSmhasherWindowed(t *testing.T) { windowed(t, &BytesKey{make([]byte, 128)}) } func windowed(t *testing.T, k Key) { + if GOARCH == "wasm" { + t.Skip("Too slow on wasm") + } if testing.Short() { t.Skip("Skipping in short mode") } diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index 96fcfc9703..e8567f4952 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.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. -// +build !nacl +// +build !nacl,!js package pprof diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go index 2ece829071..ad325987ac 100644 --- a/src/runtime/proc_test.go +++ b/src/runtime/proc_test.go @@ -28,6 +28,9 @@ func perpetuumMobile() { } func TestStopTheWorldDeadlock(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("no preemption on wasm yet") + } if testing.Short() { t.Skip("skipping during short test") } @@ -230,6 +233,10 @@ func TestBlockLocked(t *testing.T) { } func TestTimerFairness(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("no preemption on wasm yet") + } + done := make(chan bool) c := make(chan bool) for i := 0; i < 2; i++ { @@ -256,6 +263,10 @@ func TestTimerFairness(t *testing.T) { } func TestTimerFairness2(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("no preemption on wasm yet") + } + done := make(chan bool) c := make(chan bool) for i := 0; i < 2; i++ { @@ -290,6 +301,10 @@ var preempt = func() int { } func TestPreemption(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("no preemption on wasm yet") + } + // Test that goroutines are preempted at function calls. N := 5 if testing.Short() { @@ -313,6 +328,10 @@ func TestPreemption(t *testing.T) { } func TestPreemptionGC(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("no preemption on wasm yet") + } + // Test that pending GC preempts running goroutines. P := 5 N := 10 @@ -385,6 +404,9 @@ func TestNumGoroutine(t *testing.T) { } func TestPingPongHog(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("no preemption on wasm yet") + } if testing.Short() { t.Skip("skipping in -short mode") } @@ -834,6 +856,10 @@ func TestStealOrder(t *testing.T) { } func TestLockOSThreadNesting(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("no threads on wasm yet") + } + go func() { e, i := runtime.LockOSCounts() if e != 0 || i != 0 { diff --git a/src/runtime/runtime_test.go b/src/runtime/runtime_test.go index d5b6b3ac3c..8263d4059a 100644 --- a/src/runtime/runtime_test.go +++ b/src/runtime/runtime_test.go @@ -169,6 +169,9 @@ func testSetPanicOnFault(t *testing.T, addr uintptr, nfault *int) { if GOOS == "nacl" { t.Skip("nacl doesn't seem to fault on high addresses") } + if GOOS == "js" { + t.Skip("js does not support catching faults") + } defer func() { if err := recover(); err != nil { @@ -264,7 +267,7 @@ func TestTrailingZero(t *testing.T) { } func TestBadOpen(t *testing.T) { - if GOOS == "windows" || GOOS == "nacl" { + if GOOS == "windows" || GOOS == "nacl" || GOOS == "js" { t.Skip("skipping OS that doesn't have open/read/write/close") } // make sure we get the correct error code if open fails. Same for diff --git a/src/runtime/rwmutex_test.go b/src/runtime/rwmutex_test.go index 872b3b098e..291a32ea5e 100644 --- a/src/runtime/rwmutex_test.go +++ b/src/runtime/rwmutex_test.go @@ -47,6 +47,9 @@ func doTestParallelReaders(numReaders int) { } func TestParallelRWMutexReaders(t *testing.T) { + if GOARCH == "wasm" { + t.Skip("wasm has no threads yet") + } defer GOMAXPROCS(GOMAXPROCS(-1)) // If runtime triggers a forced GC during this test then it will deadlock, // since the goroutines can't be stopped/preempted. diff --git a/src/runtime/stack_test.go b/src/runtime/stack_test.go index 91d10bad5c..81a637ccb3 100644 --- a/src/runtime/stack_test.go +++ b/src/runtime/stack_test.go @@ -76,6 +76,10 @@ func TestStackMem(t *testing.T) { // Test stack growing in different contexts. func TestStackGrowth(t *testing.T) { + if GOARCH == "wasm" { + t.Skip("fails on wasm (too slow?)") + } + // Don't make this test parallel as this makes the 20 second // timeout unreliable on slow builders. (See issue #19381.) diff --git a/src/syscall/syscall_test.go b/src/syscall/syscall_test.go index c3fffda2df..2a9d90e64c 100644 --- a/src/syscall/syscall_test.go +++ b/src/syscall/syscall_test.go @@ -62,8 +62,8 @@ func TestExecErrPermutedFds(t *testing.T) { } func TestGettimeofday(t *testing.T) { - if runtime.GOOS == "nacl" { - t.Skip("not implemented on nacl") + if runtime.GOOS == "nacl" || runtime.GOOS == "js" { + t.Skip("not implemented on " + runtime.GOOS) } tv := &syscall.Timeval{} if err := syscall.Gettimeofday(tv); err != nil { diff --git a/src/text/template/exec.go b/src/text/template/exec.go index 916be46b86..8f8b5fe218 100644 --- a/src/text/template/exec.go +++ b/src/text/template/exec.go @@ -19,7 +19,14 @@ import ( // templates. This limit is only practically reached by accidentally // recursive template invocations. This limit allows us to return // an error instead of triggering a stack overflow. -const maxExecDepth = 100000 +var maxExecDepth = initMaxExecDepth() + +func initMaxExecDepth() int { + if runtime.GOARCH == "wasm" { + return 1000 + } + return 100000 +} // state represents the state of an execution. It's not part of the // template so that multiple executions of the same template |
