-add_test(NAME engine
- COMMAND perl run_tests
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)
-set_tests_properties(engine PROPERTIES ENVIRONMENT OPENSSL_ENGINES=${OUTPUT_DIRECTORY})
+add_executable(test_gost89 test_gost89.c)
+target_link_libraries(test_gost89 gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY})
+add_test(NAME gost89
+ COMMAND test_gost89)
+
+if(NOT SKIP_PERL_TESTS)
+ execute_process(COMMAND perl -MTest2::V0 -e ""
+ ERROR_QUIET RESULT_VARIABLE HAVE_TEST2_V0)
+ if(NOT HAVE_TEST2_V0)
+ add_test(NAME engine
+ COMMAND perl run_tests
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)
+ set_tests_properties(engine PROPERTIES ENVIRONMENT
+ "OPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR};OPENSSL_ENGINES=${OUTPUT_DIRECTORY};OPENSSL_CONF=${CMAKE_SOURCE_DIR}/test/empty.cnf")
+ else()
+ message(STATUS "No Test2::V0 perl module (engine tests skipped)")
+ endif()
+endif()
+
+add_executable(sign benchmark/sign.c)
+target_link_libraries(sign gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY} ${CLOCK_GETTIME_LIB})
+
+# All that may need to load just built engine will have path to it defined.
+set(BINARY_TESTS_TARGETS
+ test_digest
+ test_ciphers
+ test_curves
+ test_params
+ test_derive
+ test_sign
+ test_context
+ test_keyexpimp
+ test_gost89
+ test_tls
+ )
+set_property(TARGET ${BINARY_TESTS_TARGETS} APPEND PROPERTY COMPILE_DEFINITIONS ENGINE_DIR="${OUTPUT_DIRECTORY}")