Bump bitcoin dep to 0.21
[rust-lightning] / fuzz / travis-fuzz.sh
1 #!/bin/bash
2 set -e
3
4 pushd src/msg_targets
5 rm msg_*.rs
6 ./gen_target.sh
7 [ "$(git diff)" != "" ] && exit 1
8 popd
9 pushd src/bin
10 rm *_target.rs
11 ./gen_target.sh
12 [ "$(git diff)" != "" ] && exit 1
13 popd
14
15 cargo install --force honggfuzz
16 for TARGET in src/bin/*.rs; do
17         FILENAME=$(basename $TARGET)
18         FILE="${FILENAME%.*}"
19         HFUZZ_RUN_ARGS="--exit_upon_crash -v -n2"
20         if [ "$FILE" = "chanmon_consistency_target" ]; then
21                 HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -F 64 -N100000"
22         else
23                 HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -N1000000"
24         fi
25         export HFUZZ_RUN_ARGS
26         HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz" cargo hfuzz run $FILE
27         if [ -f hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT ]; then
28                 cat hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT
29                 for CASE in hfuzz_workspace/$FILE/SIG*; do
30                         cat $CASE | xxd -p
31                 done
32                 exit 1
33         fi
34 done