greenthepear/egriden

Make snapshot tests

Opened this issue · 3 comments

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.

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

Issue opened on ebitengine's repo: hajimehoshi/ebiten#3010

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