Skip to content

Commit

Permalink
Disable fuzztest flags for coverage. (AOMediaCodec#1915)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud authored Jan 8, 2024
1 parent 2660e05 commit 30f93cc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/oss-fuzz/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,23 @@ ln -s $SRC/fuzztest $SRC/libavif/ext/fuzztest
# build dependencies
cd ext && bash aom.cmd && bash dav1d.cmd && bash googletest.cmd && bash libjpeg.cmd && \
bash libsharpyuv.cmd && bash libyuv.cmd && bash zlibpng.cmd && cd ..
export CXXFLAGS="${CXXFLAGS} -DFUZZTEST_COMPATIBILITY_MODE"

# build libavif
mkdir build
cd build
if [ "$FUZZING_ENGINE" == "libfuzzer" ] && [ "$SANITIZER" != "coverage" ]
then
export CXXFLAGS="${CXXFLAGS} -DFUZZTEST_COMPATIBILITY_MODE"
export EXTRA_CMAKE_FLAGS="-DAVIF_ENABLE_FUZZTEST=ON -DFUZZTEST_COMPATIBILITY_MODE=libfuzzer"
fi
cmake .. -G Ninja -DBUILD_SHARED_LIBS=OFF -DAVIF_CODEC_AOM=LOCAL -DAVIF_CODEC_DAV1D=LOCAL \
-DAVIF_CODEC_AOM_DECODE=ON -DAVIF_CODEC_AOM_ENCODE=ON \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DAVIF_ENABLE_WERROR=OFF \
-DAVIF_LOCAL_FUZZTEST=ON \
-DAVIF_LOCAL_GTEST=ON -DAVIF_LOCAL_JPEG=ON -DAVIF_LOCAL_LIBSHARPYUV=ON \
-DAVIF_LIBYUV=LOCAL -DAVIF_LOCAL_ZLIBPNG=ON \
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=OFF -DAVIF_ENABLE_FUZZTEST=ON \
-DFUZZTEST_COMPATIBILITY_MODE=libfuzzer
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=OFF \
${EXTRA_CMAKE_FLAGS}

ninja

Expand All @@ -64,7 +68,7 @@ $CXX $CXXFLAGS -std=c++11 -I../include \
../ext/libyuv/build/libyuv.a ../ext/aom/build.libavif/libaom.a

# Restrict fuzztest tests to the only compatible fuzz engine: libfuzzer.
if [ "$FUZZING_ENGINE" == "libfuzzer" ]
if [ "$FUZZING_ENGINE" == "libfuzzer" ] && [ "$SANITIZER" != "coverage" ]
then
# build fuzztests
# The following is taken from https://github.com/google/oss-fuzz/blob/31ac7244748ea7390015455fb034b1f4eda039d9/infra/base-images/base-builder/compile_fuzztests.sh#L59
Expand Down

0 comments on commit 30f93cc

Please sign in to comment.