Compare commits

...

5 Commits

Author SHA1 Message Date
Hajime Hoshi
2bbceec451 .github/workflows: skip wasm tests for Windows
Updates #3076
2024-09-01 16:20:35 +09:00
Hajime Hoshi
99b9cff0d0 .github/workflows: specify -test.paniconexit0=false for browsers
Closes #3075
2024-09-01 15:45:15 +09:00
Hajime Hoshi
71370a01bd internal/beforemaintest: avoid os.Exit(0) 2024-09-01 13:58:39 +09:00
Hajime Hoshi
67441c4823 internal/testing: avoid os.Exit(0)
os.Exit(0) might cause test flakiness.

https://github.com/hajimehoshi/ebiten/actions/runs/10650734256/job/29522689113

```
panic: unexpected call to os.Exit(0) during test

goroutine 1 [running]:
os.Exit(0x0)
	/opt/hostedtoolcache/go/1.23.0/x64/src/os/proc.go:67 +0x8
github.com/hajimehoshi/ebiten/v2/internal/testing.MainWithRunLoop(0x19b28c0)
	/home/runner/work/ebiten/ebiten/internal/testing/testing.go:50 +0xa
github.com/hajimehoshi/ebiten/v2/internal/graphicscommand_test.TestMain(...)
	/home/runner/work/ebiten/ebiten/internal/graphicscommand/image_test.go:42
main.main()
	_testmain.go:55 +0x5
```
2024-09-01 13:31:40 +09:00
Hajime Hoshi
faeb03373d examples: remove README 2024-09-01 12:40:34 +09:00
4 changed files with 9 additions and 27 deletions

View File

@ -168,10 +168,11 @@ jobs:
env GOARCH=386 EBITENGINE_DIRECTX=version=12 go test -shuffle=on -v ./...
- name: go test (Wasm)
if: runner.os != 'macOS'
if: runner.os == 'Linux'
run: |
# Wasm tests don't work on macOS with the headless mode enabled, but the headless mode cannot be disabled in GitHub Actions (#2972).
env GOOS=js GOARCH=wasm cleanenv -remove-prefix GITHUB_ -remove-prefix JAVA_ -remove-prefix PSModulePath -remove-prefix STATS_ -remove-prefix RUNNER_ -- go test -shuffle=on -v ./...
# Wasm tests time out on Windows (#3076).
env GOOS=js GOARCH=wasm cleanenv -remove-prefix GITHUB_ -remove-prefix JAVA_ -remove-prefix PSModulePath -remove-prefix STATS_ -remove-prefix RUNNER_ -- go test -shuffle=on -v ./... -test.paniconexit0=false
- name: Install ebitenmobile
run: |

View File

@ -1,23 +0,0 @@
# How to execute the examples
## Desktops
```sh
go run github.com/hajimehoshi/ebiten/v2/examples/rotate@latest
```
## Android
Install [gomobile](https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile) first.
```sh
gomobile install github.com/hajimehoshi/ebiten/v2/examples/rotate@latest
```
## iOS
```sh
gomobile build -target=ios -work github.com/hajimehoshi/ebiten/v2/examples/rotate@latest
```
Then, open the `WORK` directory, open `main.xcodeproj`, add signing, and run the project.

View File

@ -78,7 +78,9 @@ func TestMain(m *testing.M) {
panic(err)
}
os.Exit(<-codeCh)
if code := <-codeCh; code != 0 {
os.Exit(code)
}
}
type testResult struct {

View File

@ -47,5 +47,7 @@ func MainWithRunLoop(m *testing.M) {
if err := ebiten.RunGame(g); err != nil {
panic(err)
}
os.Exit(g.code)
if g.code != 0 {
os.Exit(g.code)
}
}