]> git.bitcoin.ninja Git - rust-lightning/blob - fuzz/travis-fuzz.sh
Fix bug in early-HTLC-fulfill handling
[rust-lightning] / fuzz / travis-fuzz.sh
1 #!/bin/bash
2 set -e
3
4 pushd fuzz_targets/msg_targets
5 rm *_target.rs
6 ./gen_target.sh
7 [ "$(git diff)" != "" ] && exit 1
8 popd
9
10 cargo install --force honggfuzz
11 for TARGET in fuzz_targets/*.rs fuzz_targets/msg_targets/*_target.rs; do
12         FILENAME=$(basename $TARGET)
13         FILE="${FILENAME%.*}"
14         HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz" HFUZZ_RUN_ARGS="-N1000000 --exit_upon_crash -v" cargo hfuzz run $FILE
15         if [ -f hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT ]; then
16                 cat hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT
17                 for CASE in hfuzz_workspace/$FILE/SIG*; do
18                         cat $CASE | xxd -p
19                 done
20                 exit 1
21         fi
22 done