From ce382c097931340f46947d6c82aa4ac11a08a8bf Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 13 May 2018 13:17:18 -0400 Subject: [PATCH] Make travis check that msg_targets match the template --- fuzz/fuzz_targets/msg_targets/gen_target.sh | 2 +- fuzz/travis-fuzz.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) mode change 100644 => 100755 fuzz/fuzz_targets/msg_targets/gen_target.sh 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) -- 2.39.5