mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 07:17:40 +01:00
22 lines
597 B
Bash
Executable file
22 lines
597 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
pushd fuzz_targets/msg_targets
|
|
rm *_target.rs
|
|
./gen_target.sh
|
|
[ "$(git diff)" != "" ] && exit 1
|
|
popd
|
|
|
|
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
|