diff --git a/Rakefile b/Rakefile index 0e83a620..a6798fa0 100644 --- a/Rakefile +++ b/Rakefile @@ -35,8 +35,18 @@ task "report:sample", [:embed] do |_t, args| ruby "scripts/generate_sample_report.rb #{embed_arg}" end +desc "Remove screenshot diff artifacts (keeps baselines)" +task "snap_diff:clean" do + patterns = ["**/*.diff.png", "**/*.base.diff.png", "**/*.heatmap.diff.png", + "**/*.diff.webp", "**/*.base.diff.webp", "**/*.heatmap.diff.webp", + "**/snap_diff_report.html"] + removed = patterns.flat_map { |p| Dir.glob("tmp/#{p}") + Dir.glob("doc/screenshots/#{p}") } + removed.each { |f| FileUtils.rm_f(f) } + puts "Removed #{removed.size} diff artifacts" +end + task "clobber" do - puts "Cleanup tmp/*.png" + puts "Cleanup tmp/" FileUtils.rm_rf(Dir["./tmp/*"]) end diff --git a/test/fixtures/images/README.md b/test/fixtures/images/README.md new file mode 100644 index 00000000..355989da --- /dev/null +++ b/test/fixtures/images/README.md @@ -0,0 +1,24 @@ +# Test Fixture Images + +These images are used by the unit test suite for image comparison testing. + +| File | Description | +|------|-------------| +| `a.png` | Base island map (80x80) | +| `b.png` | Modified island map — small region differs from `a.png` | +| `c.png` | Modified island map — different region differs from `a.png` | +| `d.png` | Modified island map — another variation | +| `a_cropped.png` | Cropped version of `a.png` | +| `portrait.png` | Portrait orientation image (3x6) | +| `portrait_b.png` | Modified portrait — differs from `portrait.png` | +| `a.webp` | WebP version of `a.png` | + +## Generated artifacts (gitignored) + +These files are generated during test runs and should NOT be committed: + +| Pattern | Description | +|---------|-------------| +| `*.diff.png` | Annotated diff overlay | +| `*.base.diff.png` | Annotated base image | +| `*.heatmap.diff.png` | Heatmap of pixel differences |