Revert "ebiten: Skip heavy tests even on Wasm"

This reverts commit 0ee70df466.

Reason: This didn't affect the results
This commit is contained in:
Hajime Hoshi 2020-08-19 22:55:32 +09:00
parent 9c85b20817
commit 80d04732c2

View File

@ -22,7 +22,9 @@ import (
"image/draw" "image/draw"
_ "image/png" _ "image/png"
"math" "math"
"regexp"
"runtime" "runtime"
"strconv"
"testing" "testing"
. "github.com/hajimehoshi/ebiten" . "github.com/hajimehoshi/ebiten"
@ -38,13 +40,19 @@ func skipTooSlowTests(t *testing.T) bool {
return true return true
} }
if runtime.GOOS == "js" { if runtime.GOOS == "js" {
// In Go1.12, converting JS arrays from/to slices uses TypedArrayOf, and this might allocates too v := runtime.Version()
// many ArrayBuffers. if m := regexp.MustCompile(`^go(\d+)\.(\d+)`).FindStringSubmatch(v); m != nil {
// major, _ := strconv.Atoi(m[1])
// Even in the latest versions, timeout often happens especially on Windows/Wasm (#1313). minor, _ := strconv.Atoi(m[2])
t.Skip("too slow on Wasm")
// In Go1.12, converting JS arrays from/to slices uses TypedArrayOf, and this might allocates
// too many ArrayBuffers.
if major == 1 && minor <= 12 {
t.Skipf("too slow on Go%d.%dWasm", major, minor)
return true return true
} }
}
}
return false return false
} }