Run this command to regenerate reference (ground truth) images:
BLENDER_TEST_UPDATE=1 ctest -R %ENGINE_NAME%
This then happens for new and failing tests; reference images of passing test cases will not be updated. Be sure to commit the new reference images under the tests/files folder afterwards.