Files
libssh/tests/fuzz/CMakeLists.txt
Stanislav Zidek ce26b56e13 client configuration fuzzing and fixes
Signed-off-by: Stanislav Zidek <szidek@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2021-11-02 11:33:26 +01:00

25 lines
858 B
CMake

project(fuzzing CXX)
macro(fuzzer name)
add_executable(${name} ${name}.cpp)
target_link_libraries(${name}
PRIVATE
ssh::static)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set_target_properties(${name}
PROPERTIES
COMPILE_FLAGS "-fsanitize=fuzzer"
LINK_FLAGS "-fsanitize=fuzzer")
# Run the fuzzer to make sure it works
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name} -runs=1)
else()
target_sources(${name} PRIVATE fuzzer.c)
# Run the fuzzer to make sure it works
# add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name} EXAMPLE)
endif()
endmacro()
fuzzer(ssh_client_fuzzer)
fuzzer(ssh_server_fuzzer)
fuzzer(ssh_client_config_fuzzer)