-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- wip: fix (fuzz) test
- Loading branch information
Showing
6 changed files
with
25 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
# A fuzz test runs until it finds an error. This particular one is going to rely on libFuzzer. | ||
# | ||
add_executable(ecs-benchmark-fuzz-tester) | ||
target_sources(ecs-benchmark-fuzz-tester PRIVATE ${${CMAKE_PROJECT_NAME}_FUZZ_TEST_SOURCE} ${${CMAKE_PROJECT_NAME}_FUZZ_TEST_HEADERS}) | ||
target_sources(ecs-benchmark-fuzz-tester PRIVATE fuzz_tester.cpp) | ||
target_include_directories(ecs-benchmark-fuzz-tester PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
# @NOTE: add libs here | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
target_link_libraries(${CMAKE_PROJECT_NAME}-fuzz-tester Threads::Threads) | ||
find_package(Threads REQUIRED) | ||
target_link_libraries(ecs-benchmark-fuzz-tester PRIVATE Threads::Threads) | ||
|
||
target_link_options(${CMAKE_PROJECT_NAME}-fuzz-tester PRIVATE project_options project_warnings -coverage | ||
-fsanitize=fuzzer,undefined,address) | ||
target_compile_options(${CMAKE_PROJECT_NAME}-fuzz-tester PRIVATE -fsanitize=fuzzer,undefined,address) | ||
target_link_libraries(ecs-benchmark-fuzz-tester PRIVATE project_warnings project_options) | ||
#target_link_options(ecs-benchmark-fuzz-tester PRIVATE -coverage -fsanitize=fuzzer,undefined,address) | ||
#target_compile_options(ecs-benchmark-fuzz-tester PRIVATE -fsanitize=fuzzer,undefined,address) | ||
# @FIXME: c++: error: unrecognized argument to '-fsanitize=' option: 'fuzzer' | ||
|
||
# Allow short runs during automated testing to see if something new breaks | ||
set(FUZZ_RUNTIME | ||
10 | ||
CACHE STRING "Number of seconds to run fuzz tests during ctest run") # Default of 10 seconds | ||
|
||
add_test(NAME ${CMAKE_PROJECT_NAME}-fuzz-tester-run COMMAND ${CMAKE_PROJECT_NAME}-fuzz-tester -max_total_time=${FUZZ_RUNTIME}) | ||
add_test(NAME ecs-benchmark-fuzz-tester-run COMMAND ecs-benchmark-fuzz-tester -max_total_time=${FUZZ_RUNTIME}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters