mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
ebiten: Skip some tests on Wasm
They are flagile and sometimes causes crash on GitHub Actions workflow tests.
This commit is contained in:
parent
12e5617396
commit
442849e120
@ -22,9 +22,7 @@ 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"
|
||||||
@ -44,18 +42,8 @@ func skipTooSlowTests(t *testing.T) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if runtime.GOOS == "js" {
|
if runtime.GOOS == "js" {
|
||||||
v := runtime.Version()
|
t.Skip("too slow or fragile on Wasm")
|
||||||
if m := regexp.MustCompile(`^go(\d+)\.(\d+)`).FindStringSubmatch(v); m != nil {
|
return true
|
||||||
major, _ := strconv.Atoi(m[1])
|
|
||||||
minor, _ := strconv.Atoi(m[2])
|
|
||||||
|
|
||||||
// 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 false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user