#!/usr/bin/env bash # seed.sh: fill fuzz/corpus// from the repo's still-image fixtures. # # Every file under tests/data/stills seeds each whole-file target: decode, decode_animation, probe. # Corpus lives under fuzz/corpus, which is git-ignored. set -euo pipefail FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd) STILLS="$FUZZ_DIR/../tests/data/stills" [ -d "$STILLS" ] || { echo "seed.sh: $STILLS missing" >&2; exit 2; } CORPUS="$FUZZ_DIR/corpus" TARGETS=(decode decode_animation probe) mkdir -p "${TARGETS[@]/#/$CORPUS/}" n=0 for path in "$STILLS"/*; do [ -f "$path" ] || continue for t in "${TARGETS[@]}"; do cp "$path" "$CORPUS/$t/$(basename "$path")" n=$((n + 1)) done done [ "$n" -gt 0 ] || { echo "seed.sh: no still-image fixtures found" >&2; exit 2; } echo "seeded $n files under $CORPUS"