greenthepear / egriden

Ebitengine framework for creating simple grid-based games
Apache License 2.0
8 stars 0 forks source link

Make snapshot tests #1

Open greenthepear opened 5 months ago

greenthepear commented 5 months ago

We must find a reliable way to do snapshot testing rather than eyeballing stuff. Ebitengine's rendering makes it tricky to compare what is being rendered to a premade image since all the ebiten.Image methods need to be called when the game is running, making writing tests rather challenging - something like cb0fb1f simply doesn't work.

Essentially the task is to either write tests that features a game loop or find another way to get ebiten.Images rendered and compared to premade ones in them.

I think I will also open an issue on Ebitengine's repo to either get some debugging tools or at least get some advice.

greenthepear commented 5 months ago

Has been achieved here, if not in a tricky way: https://github.com/tinne26/etxt/blob/main/testdata_generate.go

greenthepear commented 5 months ago

Issue opened on ebitengine's repo: https://github.com/hajimehoshi/ebiten/issues/3010

greenthepear commented 5 months ago

Thanks to the issue I've been notified that TestMain is a thing. The task is now to create these tests