Skip to content

Commit ce382c0

Browse files
committed
Make travis check that msg_targets match the template
1 parent eccd527 commit ce382c0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

fuzz/fuzz_targets/msg_targets/gen_target.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
for target in CommitmentSigned FundingCreated FundingLocked FundingSigned OpenChannel RevokeAndACK Shutdown UpdateAddHTLC UpdateFailHTLC UpdateFailMalformedHTLC UpdateFee UpdateFulfillHTLC AcceptChannel ClosingSigned; do
1+
for target in CommitmentSigned FundingCreated FundingLocked FundingSigned OpenChannel RevokeAndACK Shutdown UpdateAddHTLC UpdateFailHTLC UpdateFailMalformedHTLC UpdateFee UpdateFulfillHTLC AcceptChannel ClosingSigned; do
22
tn=$(echo $target | sed 's/\([a-z0-9]\)\([A-Z]\)/\1_\L\2/g')
33
fn=msg_$(echo $tn | tr '[:upper:]' '[:lower:]')_target.rs
44
cat msg_target_template.txt | sed s/MSG_TARGET/$target/ > $fn

fuzz/travis-fuzz.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/bash
22
set -e
3+
4+
pushd fuzz_targets/msg_targets
5+
rm *_target.rs
6+
./gen_target.sh
7+
[ "$(git diff)" != "" ] && exit 1
8+
popd
9+
310
cargo install --force honggfuzz
411
for TARGET in fuzz_targets/*.rs fuzz_targets/msg_targets/*_target.rs; do
512
FILENAME=$(basename $TARGET)

0 commit comments

Comments
 (0)