facebookarchive / ios-snapshot-test-case

Snapshot view unit tests for iOS
MIT License
2.66k stars 253 forks source link

Add a property to set the image diff directory #214

Closed alanzeino closed 7 years ago

alanzeino commented 7 years ago

It is possible to set the reference images directory using both an environment variable (FB_REFERENCE_IMAGE_DIR) and a property (referenceImagesDirectory), but the same flexibility isn't afforded to the image diff directory, which is only settable using an environment variable (IMAGE_DIFF_DIR). This pull request also adds a property (imageDiffDirectory) for the image diff directory location.

alanzeino commented 7 years ago

I learned later that this is only half of the solution; even adding this property doesn't help since it can't be set as the test case doesn't expose the controller in its public interface.

I did do a large–ish refactor to get this to a place where it is actually settable, but then when I considered the commit churn I didn't think this would be a useful feature to add into the public repository. It requires making IMAGE_DIFF_DIR even more of a first–class citizen like FB_REFERENCE_IMAGE_DIR; i.e., making it settable as a pre–processor c string, etc.

If someone really wants this I can always put that full pull request up; I've got it stashed away.