aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorRichard Musiol <mail@richard-musiol.de>2018-03-04 12:15:37 +0100
committerBrad Fitzpatrick <bradfitz@golang.org>2018-04-30 19:39:18 +0000
commite3c684777a05ca5a4f9bb59983e07c4e6a7a5e15 (patch)
tree938e64179085a5a716442f77d600882ac929d375 /src/runtime
parent1b44167d055464f79c026d2023953ba7efdbcfe6 (diff)
downloadgo-e3c684777a05ca5a4f9bb59983e07c4e6a7a5e15.tar.xz
all: skip unsupported tests for js/wasm
The general policy for the current state of js/wasm is that it only has to support tests that are also supported by nacl. The test nilptr3.go makes assumptions about which nil checks can be removed. Since WebAssembly does not signal on reading a null pointer, all nil checks have to be explicit. Updates #18892 Change-Id: I06a687860b8d22ae26b1c391499c0f5183e4c485 Reviewed-on: https://go-review.googlesource.com/110096 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/chanbarrier_test.go2
-rw-r--r--src/runtime/crash_nonunix_test.go2
-rw-r--r--src/runtime/gc_test.go4
-rw-r--r--src/runtime/hash_test.go15
-rw-r--r--src/runtime/pprof/pprof_test.go2
-rw-r--r--src/runtime/proc_test.go26
-rw-r--r--src/runtime/runtime_test.go5
-rw-r--r--src/runtime/rwmutex_test.go3
-rw-r--r--src/runtime/stack_test.go4
9 files changed, 59 insertions, 4 deletions
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.)