Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions fuzzing/ossfuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@
# build the fuzzers does not require changes in oss fuzz but instead can
# be done in the glaze repository.

set -eux
set -ux

$CXX --version

BUILT=0
for SRCFILE in $(ls fuzzing/*.cpp |grep -v -E '(exhaustive|main\.cpp)'); do
NAME=$(basename $SRCFILE .cpp)
$CXX $CXXFLAGS -std=c++23 -g -Iinclude \
if $CXX $CXXFLAGS -std=c++23 -g -Iinclude \
$SRCFILE -o $OUT/$NAME \
$LIB_FUZZING_ENGINE
$LIB_FUZZING_ENGINE; then
BUILT=$((BUILT + 1))
else
echo "WARNING: failed to build $NAME, skipping" >&2
fi
done

if [ "$BUILT" -eq 0 ]; then
echo "ERROR: no fuzzers built" >&2
exit 1
fi