aboutsummaryrefslogtreecommitdiff
path: root/tests/fuzz/CMakeLists.txt
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-02-02 16:28:38 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-07-08 14:58:59 +0200
commit85951a156bf0fe116fdee31ab380a382b6b73118 (patch)
treeba41da3f1bbe03d61d2a98b3d7cc665e823a01e6 /tests/fuzz/CMakeLists.txt
parentb5a8547d91366f0fd171cb3956375f3db181c53f (diff)
downloadlibssh-85951a156bf0fe116fdee31ab380a382b6b73118.tar.gz
libssh-85951a156bf0fe116fdee31ab380a382b6b73118.tar.xz
libssh-85951a156bf0fe116fdee31ab380a382b6b73118.zip
tests: Add ssh_client_fuzzer
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'tests/fuzz/CMakeLists.txt')
-rw-r--r--tests/fuzz/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt
index 72ca1f47..d8663b51 100644
--- a/tests/fuzz/CMakeLists.txt
+++ b/tests/fuzz/CMakeLists.txt
@@ -1,6 +1,16 @@
project(fuzzing CXX)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ add_executable(ssh_client_fuzzer ssh_client_fuzzer.cpp)
+ target_link_libraries(ssh_client_fuzzer
+ PRIVATE
+ ${LIBSSH_STATIC_LIBRARY})
+ set_target_properties(ssh_client_fuzzer
+ PROPERTIES
+ COMPILE_FLAGS "-fsanitize=fuzzer"
+ LINK_FLAGS "-fsanitize=fuzzer")
+
+
add_executable(ssh_server_fuzzer ssh_server_fuzzer.cpp)
target_link_libraries(ssh_server_fuzzer
PRIVATE
@@ -11,5 +21,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
LINK_FLAGS "-fsanitize=fuzzer")
# Run the fuzzer to make sure it works
+ add_test(ssh_client_fuzzer ${CMAKE_CURRENT_BINARY_DIR}/ssh_client_fuzzer -runs=1)
add_test(ssh_server_fuzzer ${CMAKE_CURRENT_BINARY_DIR}/ssh_server_fuzzer -runs=1)
endif()