From e39ef9c6361c79090c2adf4537d6eafb073e9522 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Tue, 7 Sep 2021 16:17:12 -0400 Subject: [PATCH] Copy dictionaries over to help steer fuzzing. (#6414) --- projects/swift-protobuf/build.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/projects/swift-protobuf/build.sh b/projects/swift-protobuf/build.sh index ee291dac4..4c30102bb 100755 --- a/projects/swift-protobuf/build.sh +++ b/projects/swift-protobuf/build.sh @@ -17,15 +17,25 @@ . precompile_swift -# build project cd FuzzTesting + +# debug build swift build -c debug $SWIFTFLAGS ( cd .build/debug/ find . -maxdepth 1 -type f -name "Fuzz*" -executable | while read i; do cp $i $OUT/"$i"_debug; done ) + +# release build swift build -c release $SWIFTFLAGS ( cd .build/release/ find . -maxdepth 1 -type f -name "Fuzz*" -executable | while read i; do cp $i $OUT/"$i"_release; done ) + +# Copy any dictionaries over. +for fuzz_dict in Fuzz*.dict ; do + fuzzer_name=$(basename $fuzz_dict .dict) + cp $fuzz_dict $OUT/${fuzzer_name}_debug.dict + cp $fuzz_dict $OUT/${fuzzer_name}_release.dict +done