From: Matt Corallo Date: Sun, 13 May 2018 17:17:18 +0000 (-0400) Subject: Make travis check that msg_targets match the template X-Git-Tag: v0.0.12~406^2~2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=ce382c097931340f46947d6c82aa4ac11a08a8bf;p=rust-lightning Make travis check that msg_targets match the template --- diff --git a/fuzz/fuzz_targets/msg_targets/gen_target.sh b/fuzz/fuzz_targets/msg_targets/gen_target.sh old mode 100644 new mode 100755 index 6a1071736..8e9ed04da --- a/fuzz/fuzz_targets/msg_targets/gen_target.sh +++ b/fuzz/fuzz_targets/msg_targets/gen_target.sh @@ -1,4 +1,4 @@ -for target in CommitmentSigned FundingCreated FundingLocked FundingSigned OpenChannel RevokeAndACK Shutdown UpdateAddHTLC UpdateFailHTLC UpdateFailMalformedHTLC UpdateFee UpdateFulfillHTLC AcceptChannel ClosingSigned; do +for target in CommitmentSigned FundingCreated FundingLocked FundingSigned OpenChannel RevokeAndACK Shutdown UpdateAddHTLC UpdateFailHTLC UpdateFailMalformedHTLC UpdateFee UpdateFulfillHTLC AcceptChannel ClosingSigned; do tn=$(echo $target | sed 's/\([a-z0-9]\)\([A-Z]\)/\1_\L\2/g') fn=msg_$(echo $tn | tr '[:upper:]' '[:lower:]')_target.rs cat msg_target_template.txt | sed s/MSG_TARGET/$target/ > $fn diff --git a/fuzz/travis-fuzz.sh b/fuzz/travis-fuzz.sh index a60d11855..86b57fa0b 100755 --- a/fuzz/travis-fuzz.sh +++ b/fuzz/travis-fuzz.sh @@ -1,5 +1,12 @@ #!/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)