diff --git a/fuzzing/ossfuzz.sh b/fuzzing/ossfuzz.sh index 8521e87b..d17eb03a 100755 --- a/fuzzing/ossfuzz.sh +++ b/fuzzing/ossfuzz.sh @@ -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