Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable compiler warnings in fuzztest targets #2356

Merged
Merged
Changes from 1 commit
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
11 changes: 6 additions & 5 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,7 @@ if(AVIF_ENABLE_FUZZTEST)
macro(add_avif_fuzztest TEST_NAME)
add_executable(${TEST_NAME} gtest/${TEST_NAME}.cc gtest/avif_fuzztest_helpers.cc ${ARGN})
# FuzzTest bundles GoogleTest so no need to link to gtest librairies.
# NOTE: FuzzTest and Abseil headers have compiler warnings (mostly
# -Wsign-compare and some -Wunused-parameter and -Wshorten-64-to-32),
# so we don't enable compiler warnings on the fuzztest targets.
target_link_libraries(${TEST_NAME} PRIVATE aviftest_helpers_internal)
target_link_libraries(${TEST_NAME} PRIVATE aviftest_helpers_internal avif_enable_warnings)
link_fuzztest(${TEST_NAME})
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
set_property(TEST ${TEST_NAME} PROPERTY ENVIRONMENT "TEST_DATA_DIRS=${CMAKE_CURRENT_SOURCE_DIR}/data/")
Expand All @@ -201,7 +198,11 @@ if(AVIF_ENABLE_FUZZTEST)
# FUZZTEST_REPLAY=/path/to/repro_file.test
# and running one of the targets below.
# See https://github.com/google/fuzztest/blob/main/doc/quickstart-cmake.md
add_subdirectory(${AVIF_SOURCE_DIR}/ext/fuzztest ${AVIF_SOURCE_DIR}/ext/fuzztest/build.libavif EXCLUDE_FROM_ALL)
# Note: The SYSTEM argument for add_subdirectory() is new in CMake
# version 3.25. There are compiler warnings in FuzzTest headers. Add
# the ext/fuzztest subdirectory with the SYSTEM directory property so
# that warnings in its headers are suppressed.
add_subdirectory(${AVIF_SOURCE_DIR}/ext/fuzztest ${AVIF_SOURCE_DIR}/ext/fuzztest/build.libavif EXCLUDE_FROM_ALL SYSTEM)
wantehchang marked this conversation as resolved.
Show resolved Hide resolved
else()
message(
FATAL_ERROR
Expand Down
Loading