greenthepear / egriden

Ebitengine framework for creating simple grid-based games
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Make snapshot tests #1

Open greenthepear opened 1 month ago

greenthepear commented 1 month 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 1 month ago

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

greenthepear commented 1 month ago

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

greenthepear commented 1 month ago

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