Closed ogoffart closed 1 year ago
Just adding a few info that might be related or interesting for this issue.
Snapshot/conformance testing is something I've been using on a project of mine and this is one of the reasons why, some time back, I was suggesting to add headless rendering to texture/image: https://github.com/slint-ui/slint/issues/704
While my slint code has no this kind of tests, some other code has snapshot tests and I'm using https://insta.rs/ which works fine. I've been using a simple python script to show images when necessary, but it seems that insta version 1.21 has a command to show images; didn't test it though.
Currently, we do not have any tests for the rendering. We should have tests that render images and compare theses images to make sure everything is pixel perfect.
The way I see it, we would have a folder with slint files such as
Then the test driver would render the image into .png and compare that the result is the same, (or similar enough), as the one on disk.
We would need a tool to easily compare the failing images and to easily accept the change. Maybe some kind of a dashboard that shows a list of all different image, with the two images side by side, or "blinking", with highlight over the difference. Which would allow to easily bless the differences.
We would also be able to see the difference between the different renderer (software (buffer or line by line), skia, femtovg)
Maybe in addition to just the slint file, we might need some scripting to test the result after or during animation (to make sure the partial cache works correctly)
I think it's fine for the snapshot images to be in the git repo. If we keep the image size small, their binary size should also be small enough and shouldn't be a too much of a problem, even if these file often change.