rust-lightning/fuzz/travis-fuzz.sh
Yuntai Kyong 913ea887fe add fuzz target for messages
[[bin]] section for each new target in Cargo.toml
glob chanbes in travis-fuzz.sh
2018-05-13 05:22:55 +09:00

15 lines
494 B
Bash
Executable file

#!/bin/bash
set -e
cargo install --force honggfuzz
for TARGET in fuzz_targets/*.rs fuzz_targets/msg_targets/*_target.rs; do
FILENAME=$(basename $TARGET)
FILE="${FILENAME%.*}"
HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz" HFUZZ_RUN_ARGS="-N1000000 --exit_upon_crash -v" cargo hfuzz run $FILE
if [ -f hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT ]; then
cat hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT
for CASE in hfuzz_workspace/$FILE/SIG*; do
cat $CASE | xxd -p
done
exit 1
fi
done