Path: blob/main/contrib/libder/tests/CMakeLists.txt
39482 views
set(FUZZERS fuzz_parallel fuzz_stream fuzz_write)1set(UTILS )2set(TESTS test_privkey test_pubkey)34set(ALL_TESTS ${UTILS} ${TESTS})56if(BUILD_FUZZERS)7set(UTILS ${UTILS} make_corpus)8set(ALL_TESTS ${ALL_TESTS} ${FUZZERS} make_corpus)910foreach(fuzzer IN LISTS FUZZERS)11add_executable(${fuzzer} ${fuzzer}.c)1213target_compile_options(${fuzzer} PUBLIC -fsanitize=fuzzer)14target_link_options(${fuzzer} PUBLIC -fsanitize=fuzzer)15endforeach()1617target_link_options(fuzz_parallel PUBLIC -pthread)18endif()1920foreach(prog IN LISTS UTILS TESTS)21add_executable(${prog} ${prog}.c)22endforeach()2324foreach(prog IN LISTS ALL_TESTS)25target_include_directories(${prog} PRIVATE ${CMAKE_SOURCE_DIR}/libder)26target_link_libraries(${prog} der_static)27endforeach()2829add_custom_command(TARGET test_privkey POST_BUILD30COMMAND ${CMAKE_COMMAND} -E copy31${CMAKE_CURRENT_SOURCE_DIR}/repo.priv ${CMAKE_CURRENT_BINARY_DIR}/repo.priv)32add_custom_command(TARGET test_pubkey POST_BUILD33COMMAND ${CMAKE_COMMAND} -E copy34${CMAKE_CURRENT_SOURCE_DIR}/repo.pub ${CMAKE_CURRENT_BINARY_DIR}/repo.pub)3536add_custom_target(check37DEPENDS test_pubkey test_privkey38COMMAND "${CMAKE_CURRENT_BINARY_DIR}/test_pubkey"39COMMAND "${CMAKE_CURRENT_BINARY_DIR}/test_privkey"40)414243