diff options
| author | penguin <penguin@epenguin.net> | 2025-12-13 22:29:23 -0600 |
|---|---|---|
| committer | penguin <penguin@epenguin.net> | 2025-12-14 21:40:37 -0600 |
| commit | 3ac866a907a6998896aed4281ff925ae45dac300 (patch) | |
| tree | 50bc7833f40c192ce799bcb5b204d63d3625127f | |
| parent | 52ce39d579e8ef0e6427b097ee0d53c692d6bc55 (diff) | |
| download | gentoo-utils-3ac866a907a6998896aed4281ff925ae45dac300.tar.gz | |
scripts: add fuzzer helper script
| -rwxr-xr-x | scripts/fuzz.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/fuzz.sh b/scripts/fuzz.sh new file mode 100755 index 0000000..e6550c3 --- /dev/null +++ b/scripts/fuzz.sh @@ -0,0 +1,22 @@ +#!/bin/bash +CWD="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +PROJECT_DIR=$(realpath "${CWD}/../") + +in=$(mktemp -u) || exit $? +out=$(mktemp -u) || exit $? + +mkfifo ${in} ${out} || exit $? + +if [[ -z "$FUZZER_TIMEOUT_S" ]]; then + FUZZER_TIMEOUT_S=600 +fi + + +${PROJECT_DIR}/scripts/atom.py <${in} >${out} \ + | ${PROJECT_DIR}/build/fuzz/atom/parser/fuzzer -max_total_time=$FUZZER_TIMEOUT_S >${in} <${out} \ + ${PROJECT_DIR}/build/atom_parser_fuzzer_corpus \ + -only_ascii=1 \ + -timeout=2 \ + -max_total_time=$FUZZER_TIMEOUT_S \ + -timeout_exitcode=0 \ + "$@" |
