Skip to content

Commit

Permalink
fix profraw path
Browse files Browse the repository at this point in the history
  • Loading branch information
jouho committed Dec 12, 2024
1 parent 8e1310a commit 96ebc85
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 0 additions & 4 deletions codebuild/bin/fuzz_corpus_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,5 @@ for FUZZ_TEST in tests/fuzz/*.c; do
# Store generated corpus files in the S3 bucket.
zip -r ./tests/fuzz/corpus/${TEST_NAME}.zip ./tests/fuzz/corpus/${TEST_NAME}/ > /dev/null 2>&1
aws s3 cp ./tests/fuzz/corpus/${TEST_NAME}.zip s3://s2n-tls-fuzz-corpus/${TEST_NAME}/corpus.zip

# Store generated output files in the S3 bucket.
aws s3 cp ./tests/fuzz/${TEST_NAME}_output.txt ${ARTIFACT_UPLOAD_LOC}/${TEST_NAME}/output_$(date +%Y-%m-%d-%T).txt
aws s3 cp ./tests/fuzz/${TEST_NAME}_results.txt ${ARTIFACT_UPLOAD_LOC}/${TEST_NAME}/results_$(date +%Y-%m-%d-%T).txt
done

8 changes: 4 additions & 4 deletions codebuild/bin/fuzz_coverage_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ for FUZZ_TEST in "$FUZZ_TEST_DIR"/*.c; do
TEST_NAME="${TEST_NAME%.*}"

llvm-profdata merge \
-sparse ./tests/fuzz/profiles/${TEST_NAME}/*.profraw \
-o ./tests/fuzz/profiles/${TEST_NAME}/${TEST_NAME}.profdata
-sparse tests/fuzz/profiles/${TEST_NAME}/*.profraw \
-o tests/fuzz/profiles/${TEST_NAME}/${TEST_NAME}.profdata

llvm-cov report \
-instr-profile=./tests/fuzz/profiles/${TEST_NAME}/${TEST_NAME}.profdata ./build/lib/libs2n.so ${FUZZCOV_SOURCES} \
-instr-profile=tests/fuzz/profiles/${TEST_NAME}/${TEST_NAME}.profdata build/lib/libs2n.so ${FUZZCOV_SOURCES} \
-show-functions \
> coverage/fuzz/${TEST_NAME}_cov.txt

llvm-cov export \
-instr-profile=./tests/fuzz/profiles/${TEST_NAME}/${TEST_NAME}.profdata ./build/lib/libs2n.so ${FUZZCOV_SOURCES} \
-instr-profile=tests/fuzz/profiles/${TEST_NAME}/${TEST_NAME}.profdata build/lib/libs2n.so ${FUZZCOV_SOURCES} \
-format=lcov \
> coverage/fuzz/${TEST_NAME}_cov.info

Expand Down
3 changes: 3 additions & 0 deletions tests/fuzz/runFuzzTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,8 @@ then
else
cat ${TEST_NAME}_output.txt
printf "\033[31;1mFAILED\033[0m %s, %6d features covered\n" "$TEST_INFO" $FEATURE_COVERAGE
# Store generated output files in the S3 bucket for debugging.
aws s3 cp ./tests/fuzz/${TEST_NAME}_output.txt ${ARTIFACT_UPLOAD_LOC}/${TEST_NAME}/output_$(date +%Y-%m-%d-%T).txt
aws s3 cp ./tests/fuzz/${TEST_NAME}_results.txt ${ARTIFACT_UPLOAD_LOC}/${TEST_NAME}/results_$(date +%Y-%m-%d-%T).txt
exit -1
fi

0 comments on commit 96ebc85

Please sign in to comment.