Skip to content

Commit

Permalink
oss-fuzz/build.sh: use heredoc for script creation
Browse files Browse the repository at this point in the history
Rather than a quoted multi-line echo.

Change-Id: Ib51fa5693f2946e2bc991dc66a6b3449e6ee61c0
  • Loading branch information
jzern committed Jun 6, 2024
1 parent 5007493 commit ddd6245
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/fuzzer/oss-fuzz/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ for fuzz_main_file in $FUZZ_TEST_BINARIES_OUT_PATHS; do
for fuzz_entrypoint in $FUZZ_TESTS; do
TARGET_FUZZER="${fuzz_basename}@$fuzz_entrypoint"
# Write executer script
echo "#!/bin/sh
cat << EOF > $OUT/$TARGET_FUZZER
#!/bin/sh
# LLVMFuzzerTestOneInput for fuzzer detection.
this_dir=\$(dirname \"\$0\")
export TEST_DATA_DIRS=\$this_dir/corpus
chmod +x \$this_dir/$fuzz_basename
\$this_dir/$fuzz_basename --fuzz=$fuzz_entrypoint -- \$@
chmod -x \$this_dir/$fuzz_basename" > $OUT/$TARGET_FUZZER
chmod -x \$this_dir/$fuzz_basename
EOF
chmod +x $OUT/$TARGET_FUZZER
done
# Copy data.
Expand Down

0 comments on commit ddd6245

Please sign in to comment.