Stills fixtures move into ec-image tests/data: gen-stills.sh and its python helpers live beside committed stills (4.1 MB, 94 files), ffmpeg calls use the pinned EC_FFMPEG bundle, tests and benches read tests/data/stills from CARGO_MANIFEST_DIR so no fixtures/ download is needed
Browse files at this commit131405c4f7349b4af5f578f6a2ceb3e2cd56626fParent: 47ea150102 changed files +33 -31
- crates/ec-image/fuzz/seed.sh +3 -4
- scripts/gen-still-fixtures.sh → crates/ec-image/tests/data/gen-stills.sh +20 -18
- scripts/lib/gen-bmp-shapes.py → crates/ec-image/tests/data/lib/gen-bmp-shapes.py +0 -0
- scripts/lib/gen-tiff-shapes.py → crates/ec-image/tests/data/lib/gen-tiff-shapes.py +0 -0
- crates/ec-image/tests/data/stills/alpha32.bmp +0 -0
- crates/ec-image/tests/data/stills/anim-alpha-f0.png +0 -0
- crates/ec-image/tests/data/stills/anim-alpha-f1.png +0 -0
- crates/ec-image/tests/data/stills/anim-alpha-f2.png +0 -0
- crates/ec-image/tests/data/stills/anim-alpha.webp +0 -0
- crates/ec-image/tests/data/stills/animated.gif +0 -0
- crates/ec-image/tests/data/stills/animated.webp +0 -0
- crates/ec-image/tests/data/stills/baseline-420-q50.jpg +0 -0
- crates/ec-image/tests/data/stills/baseline-420.jpg +0 -0
- crates/ec-image/tests/data/stills/baseline-422.jpg +0 -0
- crates/ec-image/tests/data/stills/baseline-444.jpg +0 -0
- crates/ec-image/tests/data/stills/bf565.bmp +0 -0
- crates/ec-image/tests/data/stills/bilevel.tiff +0 -0
- crates/ec-image/tests/data/stills/embedded-jpeg.bmp +0 -0
- crates/ec-image/tests/data/stills/embedded-png.bmp +0 -0
- crates/ec-image/tests/data/stills/gray.jpg +0 -0
- crates/ec-image/tests/data/stills/gray1.png +0 -0
- crates/ec-image/tests/data/stills/gray16.png +0 -0
- crates/ec-image/tests/data/stills/gray16.tiff +0 -0
- crates/ec-image/tests/data/stills/gray2.png +0 -0
- crates/ec-image/tests/data/stills/gray4.png +0 -0
- crates/ec-image/tests/data/stills/gray8.png +0 -0
- crates/ec-image/tests/data/stills/gray8.tiff +0 -0
- crates/ec-image/tests/data/stills/graya8.png +0 -0
- crates/ec-image/tests/data/stills/interlaced-palette.png +0 -0
- crates/ec-image/tests/data/stills/interlaced-rgb8.png +0 -0
- crates/ec-image/tests/data/stills/interlaced-rgba16.png +0 -0
- crates/ec-image/tests/data/stills/interlaced.gif +0 -0
- crates/ec-image/tests/data/stills/lossless-alpha.webp +0 -0
- crates/ec-image/tests/data/stills/lossless-palette.webp +0 -0
- crates/ec-image/tests/data/stills/lossless.webp +0 -0
- crates/ec-image/tests/data/stills/lossy-alpha.webp +0 -0
- crates/ec-image/tests/data/stills/lossy-q40.webp +0 -0
- crates/ec-image/tests/data/stills/lossy.webp +0 -0
- crates/ec-image/tests/data/stills/mono.bmp +0 -0
- crates/ec-image/tests/data/stills/odd-420.jpg +0 -0
- crates/ec-image/tests/data/stills/odd-422.jpg +0 -0
- crates/ec-image/tests/data/stills/odd-interlaced.png +0 -0
- crates/ec-image/tests/data/stills/odd-lossless.webp +0 -0
- crates/ec-image/tests/data/stills/odd-lossy.webp +0 -0
- crates/ec-image/tests/data/stills/odd-rgb8.png +0 -0
- crates/ec-image/tests/data/stills/odd.gif +0 -0
- crates/ec-image/tests/data/stills/odd24.bmp +0 -0
- crates/ec-image/tests/data/stills/os2v1.bmp +0 -0
- crates/ec-image/tests/data/stills/os2v2.bmp +0 -0
- crates/ec-image/tests/data/stills/pal4.bmp +0 -0
- crates/ec-image/tests/data/stills/pal8.bmp +0 -0
- crates/ec-image/tests/data/stills/palette1.png +0 -0
- crates/ec-image/tests/data/stills/palette2.png +0 -0
- crates/ec-image/tests/data/stills/palette4-golden.png +0 -0
- crates/ec-image/tests/data/stills/palette4.png +0 -0
- crates/ec-image/tests/data/stills/palette4.tiff +0 -0
- crates/ec-image/tests/data/stills/palette8.png +0 -0
- crates/ec-image/tests/data/stills/progressive-420.jpg +0 -0
- crates/ec-image/tests/data/stills/progressive-444.jpg +0 -0
- crates/ec-image/tests/data/stills/restart-420.jpg +0 -0
- crates/ec-image/tests/data/stills/rgb16.png +0 -0
- crates/ec-image/tests/data/stills/rgb16.tiff +0 -0
- crates/ec-image/tests/data/stills/rgb24.bmp +0 -0
- crates/ec-image/tests/data/stills/rgb555.bmp +0 -0
- crates/ec-image/tests/data/stills/rgb8-be.tiff +0 -0
- crates/ec-image/tests/data/stills/rgb8-lzw-pred.tiff +0 -0
- crates/ec-image/tests/data/stills/rgb8-lzw.tiff +0 -0
- crates/ec-image/tests/data/stills/rgb8-packbits.tiff +0 -0
- crates/ec-image/tests/data/stills/rgb8-planar.tiff +0 -0
- crates/ec-image/tests/data/stills/rgb8-tiled.tiff +0 -0
- crates/ec-image/tests/data/stills/rgb8-zip-pred.tiff +0 -0
- crates/ec-image/tests/data/stills/rgb8-zip.tiff +0 -0
- crates/ec-image/tests/data/stills/rgb8.png +0 -0
- crates/ec-image/tests/data/stills/rgb8.tiff +0 -0
- crates/ec-image/tests/data/stills/rgba16.png +0 -0
- crates/ec-image/tests/data/stills/rgba8-assoc.tiff +0 -0
- crates/ec-image/tests/data/stills/rgba8.png +0 -0
- crates/ec-image/tests/data/stills/rgba8.tiff +0 -0
- crates/ec-image/tests/data/stills/rle4.bmp +0 -0
- crates/ec-image/tests/data/stills/rle8.bmp +0 -0
- crates/ec-image/tests/data/stills/source-alpha.png +0 -0
- crates/ec-image/tests/data/stills/source-flat.png +0 -0
- crates/ec-image/tests/data/stills/source-odd.png +0 -0
- crates/ec-image/tests/data/stills/source.png +0 -0
- crates/ec-image/tests/data/stills/still.gif +0 -0
- crates/ec-image/tests/data/stills/tiny-lossless.webp +0 -0
- crates/ec-image/tests/data/stills/tiny-lossy.webp +0 -0
- crates/ec-image/tests/data/stills/tiny.bmp +0 -0
- crates/ec-image/tests/data/stills/tiny.gif +0 -0
- crates/ec-image/tests/data/stills/tiny.jpg +0 -0
- crates/ec-image/tests/data/stills/tiny.png +0 -0
- crates/ec-image/tests/data/stills/tiny.tiff +0 -0
- crates/ec-image/tests/data/stills/topdown24.bmp +0 -0
- crates/ec-image/tests/data/stills/trns-gray.png +0 -0
- crates/ec-image/tests/data/stills/trns-palette.png +0 -0
- crates/ec-image/tests/data/stills/trns-rgb.png +0 -0
- crates/ec-image/tests/data/stills/trns.gif +0 -0
- crates/ec-image/tests/data/stills/v5alpha.bmp +0 -0
- crates/ec-image/tests/fuzz.rs +4 -4
- crates/ec-image/tests/it/differential.rs +2 -2
- crates/ec-image/tests/it/gaps.rs +1 -1
- tools/ec-bench/src/main.rs +3 -2
| @@ -1,7 +1,7 @@ | |||
| 1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
| 2 | # seed.sh: fill fuzz/corpus/<target>/ from the repo's still-image fixtures. | 2 | # seed.sh: fill fuzz/corpus/<target>/ from the repo's still-image fixtures. |
| 3 | # | 3 | # |
| 4 | -# Every file under fixtures/stills (PNG, JPEG, WebP, GIF, BMP, TIFF) seeds the whole-file targets: | 4 | +# Every file under tests/data/stills (PNG, JPEG, WebP, GIF, BMP, TIFF) seeds the whole-file targets: |
| 5 | # decode, decode_with_limits, info, probe, decode_animation. Each format target gets only the files of its | 5 | # decode, decode_with_limits, info, probe, decode_animation. Each format target gets only the files of its |
| 6 | # own format, so its corpus starts on the right signature. The VP8 frames under fixtures/vp8 are | 6 | # own format, so its corpus starts on the right signature. The VP8 frames under fixtures/vp8 are |
| 7 | # VP8 bitstreams, not stills, and are not used here. | 7 | # VP8 bitstreams, not stills, and are not used here. |
| @@ -10,9 +10,8 @@ | |||
| 10 | set -euo pipefail | 10 | set -euo pipefail |
| 11 | 11 | ||
| 12 | FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd) | 12 | FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd) |
| 13 | -ROOT=$(cd -- "$FUZZ_DIR/../../.." && pwd) | 13 | +STILLS="$FUZZ_DIR/../tests/data/stills" |
| 14 | -STILLS="$ROOT/fixtures/stills" | 14 | +[ -d "$STILLS" ] || { echo "seed.sh: $STILLS missing" >&2; exit 2; } |
| 15 | -[ -d "$STILLS" ] || { echo "seed.sh: $STILLS missing; run scripts/link-fixtures.sh" >&2; exit 2; } | ||
| 16 | 15 | ||
| 17 | CORPUS="$FUZZ_DIR/corpus" | 16 | CORPUS="$FUZZ_DIR/corpus" |
| 18 | mkdir -p "$CORPUS"/{decode,decode_with_limits,info,probe,decode_animation,bmp,gif,jpeg,png,tiff,webp} | 17 | mkdir -p "$CORPUS"/{decode,decode_with_limits,info,probe,decode_animation,bmp,gif,jpeg,png,tiff,webp} |
| @@ -8,15 +8,17 @@ | |||
| 8 | # JPEG variants, ffmpeg the WebP ones. | 8 | # JPEG variants, ffmpeg the WebP ones. |
| 9 | set -euo pipefail | 9 | set -euo pipefail |
| 10 | 10 | ||
| 11 | -root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | 11 | +root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 12 | -out="$root/fixtures/stills" | 12 | +out="$root/stills" |
| 13 | mkdir -p "$out" | 13 | mkdir -p "$out" |
| 14 | 14 | ||
| 15 | need() { | 15 | need() { |
| 16 | command -v "$1" >/dev/null || { echo "missing: $1" >&2; exit 1; } | 16 | command -v "$1" >/dev/null || { echo "missing: $1" >&2; exit 1; } |
| 17 | } | 17 | } |
| 18 | need magick | 18 | need magick |
| 19 | -need ffmpeg | 19 | +FF=${EC_FFMPEG:-$HOME/.cache/ec-ffmpeg/ffmpeg} |
| 20 | +[ -x "$FF" ] || { echo "missing pinned ffmpeg: $FF (set EC_FFMPEG)" >&2; exit 1; } | ||
| 21 | +[[ $("$FF" -version) == "ffmpeg version 9.0.2 "* ]] || { echo "ffmpeg is not the pinned 9.0.2" >&2; exit 1; } | ||
| 20 | 22 | ||
| 21 | # Source pictures: one with smooth and hard content at even dimensions, one at | 23 | # Source pictures: one with smooth and hard content at even dimensions, one at |
| 22 | # odd dimensions (chroma subsampling and Adam7 both round there), and one with | 24 | # odd dimensions (chroma subsampling and Adam7 both round there), and one with |
| @@ -70,22 +72,22 @@ magick "$out/source-odd.png" -quality 90 -sampling-factor 2x2 "$out/odd-420.jpg" | |||
| 70 | magick "$out/source-odd.png" -quality 90 -sampling-factor 2x1 "$out/odd-422.jpg" | 72 | magick "$out/source-odd.png" -quality 90 -sampling-factor 2x1 "$out/odd-422.jpg" |
| 71 | 73 | ||
| 72 | # --- WebP: lossy and lossless, with and without alpha ---------------------- | 74 | # --- WebP: lossy and lossless, with and without alpha ---------------------- |
| 73 | -ffmpeg -loglevel error -y -i "$out/source.png" -c:v libwebp -lossless 0 -quality 80 \ | 75 | +"$FF" -loglevel error -y -i "$out/source.png" -c:v libwebp -lossless 0 -quality 80 \ |
| 74 | "$out/lossy.webp" | 76 | "$out/lossy.webp" |
| 75 | -ffmpeg -loglevel error -y -i "$out/source.png" -c:v libwebp -lossless 0 -quality 40 \ | 77 | +"$FF" -loglevel error -y -i "$out/source.png" -c:v libwebp -lossless 0 -quality 40 \ |
| 76 | "$out/lossy-q40.webp" | 78 | "$out/lossy-q40.webp" |
| 77 | -ffmpeg -loglevel error -y -i "$out/source.png" -c:v libwebp -lossless 1 "$out/lossless.webp" | 79 | +"$FF" -loglevel error -y -i "$out/source.png" -c:v libwebp -lossless 1 "$out/lossless.webp" |
| 78 | -ffmpeg -loglevel error -y -i "$out/source-alpha.png" -c:v libwebp -lossless 1 \ | 80 | +"$FF" -loglevel error -y -i "$out/source-alpha.png" -c:v libwebp -lossless 1 \ |
| 79 | "$out/lossless-alpha.webp" | 81 | "$out/lossless-alpha.webp" |
| 80 | -ffmpeg -loglevel error -y -i "$out/source-alpha.png" -c:v libwebp -lossless 0 -quality 80 \ | 82 | +"$FF" -loglevel error -y -i "$out/source-alpha.png" -c:v libwebp -lossless 0 -quality 80 \ |
| 81 | "$out/lossy-alpha.webp" | 83 | "$out/lossy-alpha.webp" |
| 82 | -ffmpeg -loglevel error -y -i "$out/source-odd.png" -c:v libwebp -lossless 0 -quality 80 \ | 84 | +"$FF" -loglevel error -y -i "$out/source-odd.png" -c:v libwebp -lossless 0 -quality 80 \ |
| 83 | "$out/odd-lossy.webp" | 85 | "$out/odd-lossy.webp" |
| 84 | -ffmpeg -loglevel error -y -i "$out/source-odd.png" -c:v libwebp -lossless 1 "$out/odd-lossless.webp" | 86 | +"$FF" -loglevel error -y -i "$out/source-odd.png" -c:v libwebp -lossless 1 "$out/odd-lossless.webp" |
| 85 | # A palette-friendly picture, so the lossless colour-indexing transform is | 87 | # A palette-friendly picture, so the lossless colour-indexing transform is |
| 86 | # exercised rather than only the predictor one. | 88 | # exercised rather than only the predictor one. |
| 87 | magick "$out/source.png" -colors 8 "$out/source-flat.png" | 89 | magick "$out/source.png" -colors 8 "$out/source-flat.png" |
| 88 | -ffmpeg -loglevel error -y -i "$out/source-flat.png" -c:v libwebp -lossless 1 \ | 90 | +"$FF" -loglevel error -y -i "$out/source-flat.png" -c:v libwebp -lossless 1 \ |
| 89 | "$out/lossless-palette.webp" | 91 | "$out/lossless-palette.webp" |
| 90 | # An animation, which the decoder must refuse by name rather than decode. | 92 | # An animation, which the decoder must refuse by name rather than decode. |
| 91 | # ffmpeg's libwebp_anim silently writes a single still here, so ImageMagick | 93 | # ffmpeg's libwebp_anim silently writes a single still here, so ImageMagick |
| @@ -108,8 +110,8 @@ rm -f "$out/anim-a.png" "$out/anim-b.png" "$out/anim-c.png" | |||
| 108 | # libwebp's own composited frames, through Pillow, as the reference for that | 110 | # libwebp's own composited frames, through Pillow, as the reference for that |
| 109 | # animation: the `image` crate ignores the dispose-to-background flag, so it | 111 | # animation: the `image` crate ignores the dispose-to-background flag, so it |
| 110 | # cannot be the oracle for the frame that follows a disposal. | 112 | # cannot be the oracle for the frame that follows a disposal. |
| 111 | -if python3 -c "import PIL" 2>/dev/null; then | 113 | +if python3 -I -c "import PIL" 2>/dev/null; then |
| 112 | - python3 - "$out" <<'PILLOW' | 114 | + python3 -I - "$out" <<'PILLOW' |
| 113 | import sys | 115 | import sys |
| 114 | from PIL import Image | 116 | from PIL import Image |
| 115 | 117 | ||
| @@ -158,7 +160,7 @@ magick "$out/bmp-source.png" rgba:"$out/bmp-source.rgba" | |||
| 158 | magick "$out/bmp-source-alpha.png" rgba:"$out/bmp-source-alpha.rgba" | 160 | magick "$out/bmp-source-alpha.png" rgba:"$out/bmp-source-alpha.rgba" |
| 159 | magick "$out/bmp-source.png" "$out/bmp-embed.png" | 161 | magick "$out/bmp-source.png" "$out/bmp-embed.png" |
| 160 | magick "$out/bmp-source.png" -quality 85 "$out/bmp-embed.jpg" | 162 | magick "$out/bmp-source.png" -quality 85 "$out/bmp-embed.jpg" |
| 161 | -python3 "$(dirname "$0")/lib/gen-bmp-shapes.py" "$out" "$out/bmp-source.rgba" 64 48 \ | 163 | +python3 -I "$(dirname "$0")/lib/gen-bmp-shapes.py" "$out" "$out/bmp-source.rgba" 64 48 \ |
| 162 | "$out/bmp-source-alpha.rgba" "$out/bmp-embed.png" "$out/bmp-embed.jpg" | 164 | "$out/bmp-source-alpha.rgba" "$out/bmp-embed.png" "$out/bmp-embed.jpg" |
| 163 | rm -f "$out/bmp-source.png" "$out/bmp-source-alpha.png" "$out/bmp-source.rgba" \ | 165 | rm -f "$out/bmp-source.png" "$out/bmp-source-alpha.png" "$out/bmp-source.rgba" \ |
| 164 | "$out/bmp-source-alpha.rgba" "$out/bmp-embed.png" "$out/bmp-embed.jpg" | 166 | "$out/bmp-source-alpha.rgba" "$out/bmp-embed.png" "$out/bmp-embed.jpg" |
| @@ -194,7 +196,7 @@ magick "$out/tiff-source.png" -colors 16 -type palette -depth 4 -compress None \ | |||
| 194 | "$out/palette4.tiff" | 196 | "$out/palette4.tiff" |
| 195 | # The incumbent refuses a 4-bit palette outright, so ffmpeg -- which reads it -- | 197 | # The incumbent refuses a 4-bit palette outright, so ffmpeg -- which reads it -- |
| 196 | # writes the reference picture for that one fixture. | 198 | # writes the reference picture for that one fixture. |
| 197 | -ffmpeg -loglevel error -y -i "$out/palette4.tiff" "$out/palette4-golden.png" | 199 | +"$FF" -loglevel error -y -i "$out/palette4.tiff" "$out/palette4-golden.png" |
| 198 | # -alpha off, or ImageMagick attaches an alpha channel to a grey picture that | 200 | # -alpha off, or ImageMagick attaches an alpha channel to a grey picture that |
| 199 | # has none, and a two-sample grey file is a shape the incumbent refuses. | 201 | # has none, and a two-sample grey file is a shape the incumbent refuses. |
| 200 | magick "$out/tiff-source.png" -colorspace gray -alpha off -depth 8 -compress None \ | 202 | magick "$out/tiff-source.png" -colorspace gray -alpha off -depth 8 -compress None \ |
| @@ -206,7 +208,7 @@ magick "$out/tiff-source.png" -depth 16 -compress Zip "$out/rgb16.tiff" | |||
| 206 | # the straight and the premultiplied tagging, neither of which ImageMagick will | 208 | # the straight and the premultiplied tagging, neither of which ImageMagick will |
| 207 | # write on request. | 209 | # write on request. |
| 208 | magick "$out/tiff-source-alpha.png" rgba:"$out/tiff-source-alpha.rgba" | 210 | magick "$out/tiff-source-alpha.png" rgba:"$out/tiff-source-alpha.rgba" |
| 209 | -python3 "$(dirname "$0")/lib/gen-tiff-shapes.py" "$out" "$out/tiff-source-alpha.rgba" 64 48 | 211 | +python3 -I "$(dirname "$0")/lib/gen-tiff-shapes.py" "$out" "$out/tiff-source-alpha.rgba" 64 48 |
| 210 | rm -f "$out/tiff-source.png" "$out/tiff-source-alpha.png" \ | 212 | rm -f "$out/tiff-source.png" "$out/tiff-source-alpha.png" \ |
| 211 | "$out/tiff-source-alpha.rgba" | 213 | "$out/tiff-source-alpha.rgba" |
| 212 | 214 | ||
| @@ -214,9 +216,9 @@ rm -f "$out/tiff-source.png" "$out/tiff-source-alpha.png" \ | |||
| 214 | # per format is only affordable on a picture that decodes in microseconds. | 216 | # per format is only affordable on a picture that decodes in microseconds. |
| 215 | magick "$out/source.png" -resize 32x24! "$out/tiny.png" | 217 | magick "$out/source.png" -resize 32x24! "$out/tiny.png" |
| 216 | magick "$out/tiny.png" -quality 80 -sampling-factor 2x2 "$out/tiny.jpg" | 218 | magick "$out/tiny.png" -quality 80 -sampling-factor 2x2 "$out/tiny.jpg" |
| 217 | -ffmpeg -loglevel error -y -i "$out/tiny.png" -c:v libwebp -lossless 0 -quality 75 \ | 219 | +"$FF" -loglevel error -y -i "$out/tiny.png" -c:v libwebp -lossless 0 -quality 75 \ |
| 218 | "$out/tiny-lossy.webp" | 220 | "$out/tiny-lossy.webp" |
| 219 | -ffmpeg -loglevel error -y -i "$out/tiny.png" -c:v libwebp -lossless 1 "$out/tiny-lossless.webp" | 221 | +"$FF" -loglevel error -y -i "$out/tiny.png" -c:v libwebp -lossless 1 "$out/tiny-lossless.webp" |
| 220 | magick "$out/tiny.png" -colors 64 "$out/tiny.gif" | 222 | magick "$out/tiny.png" -colors 64 "$out/tiny.gif" |
| 221 | magick "$out/tiny.png" -colors 64 -type palette -compress None BMP3:"$out/tiny.bmp" | 223 | magick "$out/tiny.png" -colors 64 -type palette -compress None BMP3:"$out/tiny.bmp" |
| 222 | magick "$out/tiny.png" -depth 8 -compress LZW "$out/tiny.tiff" | 224 | magick "$out/tiny.png" -depth 8 -compress LZW "$out/tiny.tiff" |
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
Binary file changed
| @@ -114,7 +114,7 @@ fn budget_limits() -> ec_image::Limits { | |||
| 114 | const ROUNDS: usize = 10_000; | 114 | const ROUNDS: usize = 10_000; |
| 115 | 115 | ||
| 116 | fn fixtures() -> PathBuf { | 116 | fn fixtures() -> PathBuf { |
| 117 | - Path::new(env!("CARGO_MANIFEST_DIR")).join("../../fixtures/stills") | 117 | + Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/data/stills") |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | /// xorshift64*, so every run mutates the same way. | 120 | /// xorshift64*, so every run mutates the same way. |
| @@ -191,7 +191,7 @@ fn sweep(name: &str, seed_file: &str) { | |||
| 191 | // Mutated headers can claim canvases up to the budget, so a sweep is heavy too. | 191 | // Mutated headers can claim canvases up to the budget, so a sweep is heavy too. |
| 192 | let _heavy = heavy(); | 192 | let _heavy = heavy(); |
| 193 | let Ok(seed) = std::fs::read(fixtures().join(seed_file)) else { | 193 | let Ok(seed) = std::fs::read(fixtures().join(seed_file)) else { |
| 194 | - eprintln!("skipped: fixtures/stills not generated; run scripts/gen-still-fixtures.sh"); | 194 | + eprintln!("skipped: tests/data/stills missing"); |
| 195 | return; | 195 | return; |
| 196 | }; | 196 | }; |
| 197 | let mut rng = Rng(0x2545_f491_4f6c_dd1d ^ name.len() as u64); | 197 | let mut rng = Rng(0x2545_f491_4f6c_dd1d ^ name.len() as u64); |
| @@ -264,7 +264,7 @@ fn single_seed_sweeps_survive_mutation() { | |||
| 264 | #[test] | 264 | #[test] |
| 265 | fn a_gif_animation_survives_mutation() { | 265 | fn a_gif_animation_survives_mutation() { |
| 266 | let Ok(seed) = std::fs::read(fixtures().join("animated.gif")) else { | 266 | let Ok(seed) = std::fs::read(fixtures().join("animated.gif")) else { |
| 267 | - eprintln!("skipped: fixtures/stills not generated; run scripts/gen-still-fixtures.sh"); | 267 | + eprintln!("skipped: tests/data/stills missing"); |
| 268 | return; | 268 | return; |
| 269 | }; | 269 | }; |
| 270 | let _heavy = heavy(); | 270 | let _heavy = heavy(); |
| @@ -293,7 +293,7 @@ fn a_gif_animation_survives_mutation() { | |||
| 293 | #[test] | 293 | #[test] |
| 294 | fn an_animated_webp_survives_mutation() { | 294 | fn an_animated_webp_survives_mutation() { |
| 295 | let Ok(seed) = std::fs::read(fixtures().join("anim-alpha.webp")) else { | 295 | let Ok(seed) = std::fs::read(fixtures().join("anim-alpha.webp")) else { |
| 296 | - eprintln!("skipped: fixtures/stills not generated; run scripts/gen-still-fixtures.sh"); | 296 | + eprintln!("skipped: tests/data/stills missing"); |
| 297 | return; | 297 | return; |
| 298 | }; | 298 | }; |
| 299 | let _heavy = heavy(); | 299 | let _heavy = heavy(); |
| @@ -21,7 +21,7 @@ fn name_of(p: &std::path::Path) -> String { | |||
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | fn fixtures() -> PathBuf { | 23 | fn fixtures() -> PathBuf { |
| 24 | - Path::new(env!("CARGO_MANIFEST_DIR")).join("../../fixtures/stills") | 24 | + Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/data/stills") |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | /// Every fixture with one of these extensions, sorted for a stable report. | 27 | /// Every fixture with one of these extensions, sorted for a stable report. |
| @@ -43,7 +43,7 @@ fn corpus(extension: &str) -> Vec<PathBuf> { | |||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | fn skip(what: &str) -> bool { | 45 | fn skip(what: &str) -> bool { |
| 46 | - eprintln!("skipped: fixtures/stills not generated ({what}); run scripts/gen-still-fixtures.sh"); | 46 | + eprintln!("skipped: tests/data/stills missing ({what})"); |
| 47 | true | 47 | true |
| 48 | } | 48 | } |
| 49 | 49 | ||
| @@ -365,7 +365,7 @@ fn png_encoder_round_trips_bit_exact_and_matches_image_decode() { | |||
| 365 | #[test] | 365 | #[test] |
| 366 | fn png_encoder_size_against_image_on_the_still_fixture() { | 366 | fn png_encoder_size_against_image_on_the_still_fixture() { |
| 367 | let path = | 367 | let path = |
| 368 | - std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../fixtures/stills/source.png"); | 368 | + std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/data/stills/source.png"); |
| 369 | let Ok(bytes) = std::fs::read(&path) else { | 369 | let Ok(bytes) = std::fs::read(&path) else { |
| 370 | eprintln!("skipped: {} not generated", path.display()); | 370 | eprintln!("skipped: {} not generated", path.display()); |
| 371 | return; | 371 | return; |
| @@ -1088,7 +1088,8 @@ fn bench_container_demux(rows: &mut Vec<Row>) { | |||
| 1088 | 1088 | ||
| 1089 | fn bench_image_decode(rows: &mut Vec<Row>) { | 1089 | fn bench_image_decode(rows: &mut Vec<Row>) { |
| 1090 | let mut candidates: Vec<PathBuf> = Vec::new(); | 1090 | let mut candidates: Vec<PathBuf> = Vec::new(); |
| 1091 | - if let Ok(entries) = std::fs::read_dir(fixtures().join("stills")) { | 1091 | + let stills = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../crates/ec-image/tests/data/stills"); |
| 1092 | + if let Ok(entries) = std::fs::read_dir(stills) { | ||
| 1092 | candidates.extend( | 1093 | candidates.extend( |
| 1093 | entries | 1094 | entries |
| 1094 | .flatten() | 1095 | .flatten() |
| @@ -1139,7 +1140,7 @@ fn bench_image_decode(rows: &mut Vec<Row>) { | |||
| 1139 | 1140 | ||
| 1140 | fn bench_inflate(rows: &mut Vec<Row>) { | 1141 | fn bench_inflate(rows: &mut Vec<Row>) { |
| 1141 | let Some(png) = [ | 1142 | let Some(png) = [ |
| 1142 | - fixtures().join("stills/gray16.png"), | 1143 | + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../crates/ec-image/tests/data/stills/gray16.png"), |
| 1143 | home().join("Downloads/drawing-1.png"), | 1144 | home().join("Downloads/drawing-1.png"), |
| 1144 | ] | 1145 | ] |
| 1145 | .into_iter() | 1146 | .into_iter() |