]> git.bitcoin.ninja Git - rust-lightning/blob - lightning-invoice/fuzz/ci-fuzz.sh
db1b9eb388c5231d58dbb0e9d03e338f40b2c8e6
[rust-lightning] / lightning-invoice / fuzz / ci-fuzz.sh
1 #!/bin/bash
2 set -e
3 cargo install --force honggfuzz --no-default-features
4 for TARGET in fuzz_targets/*; do
5     FILENAME=$(basename $TARGET)
6         FILE="${FILENAME%.*}"
7         if [ -d hfuzz_input/$FILE ]; then
8             HFUZZ_INPUT_ARGS="-f hfuzz_input/$FILE/input"
9         fi
10         HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz" HFUZZ_RUN_ARGS="-N1000000 --exit_upon_crash -v $HFUZZ_INPUT_ARGS" cargo hfuzz run $FILE
11
12         if [ -f hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT ]; then
13                 cat hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT
14                 for CASE in hfuzz_workspace/$FILE/SIG*; do
15                         cat $CASE | xxd -p
16                 done
17                 exit 1
18         fi
19 done