]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Set travis to run honggfuzz for a while
authorMatt Corallo <git@bluematt.me>
Thu, 22 Mar 2018 21:52:07 +0000 (17:52 -0400)
committerMatt Corallo <git@bluematt.me>
Fri, 23 Mar 2018 17:16:24 +0000 (13:16 -0400)
.travis.yml
fuzz/travis-fuzz.sh [new file with mode: 0755]

index d36f12aa7425b0682f45f13731a423e182440dc8..6a21dfa0b3a14d19d726756b5f3437b562933495 100644 (file)
@@ -1,4 +1,15 @@
 language: rust
 rust:
   - stable
+  - beta
+  - 1.22.0
 cache: cargo
+
+before_install:
+  - sudo apt-get -qq update
+  - sudo apt-get install -y binutils-dev libunwind8-dev
+
+script:
+  - cargo build --verbose
+  - cargo test --verbose
+  - if [ "$(rustup show | grep default | grep stable)" != "" ]; then cd fuzz && cargo test --verbose && ./travis-fuzz.sh; fi
diff --git a/fuzz/travis-fuzz.sh b/fuzz/travis-fuzz.sh
new file mode 100755 (executable)
index 0000000..dfe03d1
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+cargo install honggfuzz
+set +e
+for TARGET in fuzz_targets/*; 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