fuzz CHANGE add fuzz_ prefix to fuzz regression tests
@@ -5,15 +5,15 @@ if (ENABLE_FUZZ_TARGETS)
if(FUZZER STREQUAL "AFL")
foreach(target_name IN LISTS fuzz_targets)
- add_executable(${target_name}_fuzz ${target_name}.c main.c $<TARGET_OBJECTS:yangobj>)
- target_link_libraries(${target_name}_fuzz yang)
- target_link_libraries(${target_name}_fuzz ${CMAKE_THREADS_LIB_INIT})
+ add_executable(${target_name}_fuzz_harness ${target_name}.c main.c $<TARGET_OBJECTS:yangobj>)
+ target_link_libraries(${target_name}_fuzz_harness yang)
+ target_link_libraries(${target_name}_fuzz_harness ${CMAKE_THREADS_LIB_INIT})
endforeach(target_name)
elseif(FUZZER STREQUAL "LibFuzzer")
foreach(target_name IN LISTS fuzz_targets)
- add_executable(${target_name}_fuzz ${target_name}.c $<TARGET_OBJECTS:yangobj>)
+ add_executable(${target_name}_fuzz_harness ${target_name}.c $<TARGET_OBJECTS:yangobj>)
set_source_files_properties(${target_name}.c PROPERTIES COMPILE_FLAGS "-fsanitize=fuzzer")
- target_link_libraries(${target_name}_fuzz yang "-fsanitize=fuzzer")
+ target_link_libraries(${target_name}_fuzz_harness yang "-fsanitize=fuzzer")
endforeach(target_name)
endif()
endif()
@@ -23,10 +23,10 @@ if (ENABLE_BUILD_TESTS)
set(fuzz_regression_tests lys_parse_mem lyd_parse_mem)
foreach(target_name IN LISTS fuzz_regression_tests)
file(COPY ${CMAKE_SOURCE_DIR}/tests/fuzz/corpus/${target_name} DESTINATION ${CMAKE_BINARY_DIR}/tests/fuzz/)
- add_executable(${target_name}_test ${target_name}.c main.c $<TARGET_OBJECTS:yangobj>)
- set_target_properties(${target_name}_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests/fuzz/${target_name}")
- target_link_libraries(${target_name}_test yang)
- target_link_libraries(${target_name}_test ${CMAKE_THREADS_LIB_INIT})
- add_test(NAME ${target_name}_test COMMAND fuzz_regression_test ${target_name}_test . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/fuzz/${target_name})
+ add_executable(fuzz_${target_name}_test ${target_name}.c main.c $<TARGET_OBJECTS:yangobj>)
+ set_target_properties(fuzz_${target_name}_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests/fuzz/${target_name}")
+ target_link_libraries(fuzz_${target_name}_test yang)
+ target_link_libraries(fuzz_${target_name}_test ${CMAKE_THREADS_LIB_INIT})
+ add_test(NAME fuzz_${target_name}_test COMMAND fuzz_regression_test fuzz_${target_name}_test . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/fuzz/${target_name})
endforeach(target_name)
endif()
