forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

seed.sh25 lines, 1.1 KiBHistoryRawDownload
1#!/usr/bin/env bash
2# seed.sh: fill fuzz/corpus/<target>/ from the committed tiny fixtures (tests/data).
3#
4# demux_ts gets every tiny fixture as is, plus a cut of the first 64 KiB of each
5# so the tail-scan path sees short files.
6# demux_ps gets every ps_* fixture and a 64 KiB cut of each.
7# ts_parts gets the first 4 KiB of each.
8#
9# Corpus lives under fuzz/corpus, which is git-ignored.
10set -euo pipefail
11FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd)
12DATA="$FUZZ_DIR/../tests/data"
13for t in demux_ts ts_parts demux_ps; do mkdir -p "$FUZZ_DIR/corpus/$t"; done
14for f in "$DATA"/tiny_*; do
15 stem=$(basename "$f"); stem=${stem%.*}_${f##*.}
16 cp "$f" "$FUZZ_DIR/corpus/demux_ts/$stem"
17 head -c 65536 "$f" > "$FUZZ_DIR/corpus/demux_ts/$stem.cut"
18 head -c 4096 "$f" > "$FUZZ_DIR/corpus/ts_parts/$stem"
19done
20for f in "$DATA"/ps_*; do
21 stem=$(basename "$f"); stem=${stem%.*}_${f##*.}
22 cp "$f" "$FUZZ_DIR/corpus/demux_ps/$stem"
23 head -c 65536 "$f" > "$FUZZ_DIR/corpus/demux_ps/$stem.cut"
24done
25echo "seeded $(ls "$FUZZ_DIR/corpus/demux_ts" | wc -l) demux_ts and $(ls "$FUZZ_DIR/corpus/ts_parts" | wc -l) ts_parts seeds"