slint icon indicating copy to clipboard operation
slint copied to clipboard

Tests for the renderers

Open ogoffart opened this issue 1 year ago • 0 comments

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

Test := Window {
    width: 80px; height: 80px;  // keep the test quite small so that rendered images don't take to much space
    GridLayout {
       // add various combination of stuff there.
    }
}

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.

ogoffart avatar Aug 22 '22 06:08 ogoffart