diff options
author | Vitaly Chikunov <vt@altlinux.org> | 2020-02-10 18:48:31 +0300 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@users.noreply.github.com> | 2020-02-17 23:19:50 +0300 |
commit | b87190ec52dc26fce072b05a2d890ea975ef219a (patch) | |
tree | 2281d7f89101b7fdcca3dc1ff0bb6954c0dcab62 | |
parent | 7ce996d12c96ffb936ec22f0a8b826c64516699f (diff) | |
download | gost-engine-b87190ec52dc26fce072b05a2d890ea975ef219a.zip gost-engine-b87190ec52dc26fce072b05a2d890ea975ef219a.tar.gz gost-engine-b87190ec52dc26fce072b05a2d890ea975ef219a.tar.bz2 |
CMakeLists.txt: Skip perl tests if there is no Test2::V0
`Test2::V0' is non standard and rarely present on systems, making `make
test' unnecessarily fail.
-rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c06970..b035b28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ endif() if (ASAN) message(STATUS "address sanitizer enabled") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -g3 -fno-omit-frame-pointer") + set(SKIP_PERL_TESTS 1) endif() # DEPRECATEDIN_3_0 CMAC @@ -207,12 +208,18 @@ target_link_libraries(test_gost89 gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY add_test(NAME gost89 COMMAND test_gost89) -if(NOT ASAN) -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") +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) |