Skip to content

Commit

Permalink
make fuzz test optional like autoconf
Browse files Browse the repository at this point in the history
This makes running the fuzz tests as part of the "make test" rule
optional. Even with this off by default, if building tests is enabled,
the fuzz test will still be compiled, and is available to run via "make
fuzz". This should enable a weekly jenkins build config to run the fuzz
tests, given that it takes a long time to run.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd authored and nickrasmussen committed Aug 9, 2018
1 parent f4055c3 commit 79a50ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ option(OPENEXR_BUILD_OPENEXR "Build OpenEXR" ON)
option(OPENEXR_BUILD_PYTHON_LIBS "Build the Python bindings" ON)
option(OPENEXR_BUILD_VIEWERS "Build the viewers" OFF)
option(OPENEXR_BUILD_TESTS "Enable the tests" ON)
# when enabled, adds the (long) running fuzz tests to the "make test" rule
# even when this is disabled, as long as OPENEXR_BUILD_TESTS is enabled, one
# can still run "make fuzz" (or equivalent)
option(OPENEXR_RUN_FUZZ_TESTS "Run damaged-input tests" OFF)
option(OPENEXR_BUILD_UTILS "Build the utility programs" ON)

option(OPENEXR_BUILD_SHARED "Build Shared Libraries" ON)
Expand Down
11 changes: 10 additions & 1 deletion OpenEXR/IlmImfFuzzTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@ TARGET_LINK_LIBRARIES ( IlmImfFuzzTest
IlmBase::IlmThread${OPENEXR_TARGET_SUFFIX}
${PTHREAD_LIB} ${ZLIB_LIBRARIES})

ADD_TEST ( TestIlmImfFuzz IlmImfFuzzTest )
IF ( OPENEXR_RUN_FUZZ_TESTS )
ADD_TEST ( TestIlmImfFuzz IlmImfFuzzTest )
# This takes a really long time to run... the default timeout is 1500 seconds or
# but this can take 10 hours to run on an older machine
SET_TESTS_PROPERTIES ( TestIlmImfFuzz PROPERTIES TIMEOUT 36000 )
ENDIF ()

ADD_CUSTOM_TARGET(fuzz ${CMAKE_CURRENT_BINARY_DIR}/IlmImfFuzzTest)
# the depends you can add in ADD_CUSTOM_TARGET only works for other add_custom_command
ADD_DEPENDENCIES(fuzz IlmImfFuzzTest)

0 comments on commit 79a50ea

Please sign in to comment.