Commit 5bba9d0d authored by Sandro Knauß's avatar Sandro Knauß
Browse files

MessageCore: cleanup autotests for Autocrypt.

parent fe5d5025
add_subdirectory(gnupg_home)
add_definitions( -DMAIL_DATA_DIR="${CMAKE_SOURCE_DIR}/mimetreeparser/autotests/data" )
add_definitions( -DDATA_DIR="${CMAKE_SOURCE_DIR}/messagecore/autotests/data" )
# Convenience macro to add unit tests.
macro(add_messagecore_test _source )
add_definitions(-DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
......@@ -9,6 +12,29 @@ macro(add_messagecore_test _source )
)
endmacro()
include(${CMAKE_SOURCE_DIR}/cmake/modules/kdepim_add_gpg_crypto_test.cmake)
macro( add_messagecore_cryptotest _source )
get_filename_component( _name ${_source} NAME_WE )
add_executable( ${_name} ${_source} )
target_link_libraries(
${_name}
KF5::Archive
KF5::Codecs
KF5::Completion
KF5::ConfigCore
KF5::CoreAddons
KF5::Libkleo
KF5::MessageCore
KF5::MimeTreeParser
QGpgme
Qt5::Test
Qt5::Widgets
)
add_gpg_crypto_test(${_name} messagecore-${_name})
set_tests_properties(messagecore-${_name} PROPERTIES RUN_SERIAL TRUE) # can't be parallelized due to gpg-agent
endmacro()
# Attachment tests.
add_messagecore_test( attachmentcompressjobtest.cpp )
add_messagecore_test( attachmentfrommimecontentjobtest.cpp )
......@@ -21,52 +47,7 @@ add_messagecore_test( attachmentupdatejobtest.cpp )
add_messagecore_test( stringutiltest.cpp )
add_messagecore_test( mailinglisttest.cpp )
add_definitions( -DMAIL_DATA_DIR="${CMAKE_SOURCE_DIR}/mimetreeparser/autotests/data" )
add_definitions( -DDATA_DIR="${CMAKE_SOURCE_DIR}/messagecore/autotests/data" )
include(${CMAKE_SOURCE_DIR}/cmake/modules/kdepim_add_gpg_crypto_test.cmake)
add_executable(autocryptrecipienttest
autocryptrecipienttest.cpp
../src/autocrypt/autocryptrecipient.cpp
)
target_link_libraries(autocryptrecipienttest
Qt5::Test
KF5::Libkleo KF5::MessageCore Qt5::Widgets
KF5::Archive KF5::Completion KF5::ConfigCore
KF5::CoreAddons KF5::Codecs KF5::MimeTreeParser
QGpgme Gpgmepp
)
ecm_mark_as_test(messagecore-autocryptrecipienttest)
add_gpg_crypto_test(autocryptrecipienttest messagecore-autocryptrecipienttest)
add_executable(autocryptstoragetest
autocryptstoragetest.cpp
../src/autocrypt/autocryptrecipient.cpp
)
target_link_libraries(autocryptstoragetest
Qt5::Test
KF5::Libkleo KF5::MessageCore Qt5::Widgets
KF5::Archive KF5::Completion KF5::ConfigCore
KF5::CoreAddons KF5::Codecs KF5::MimeTreeParser
QGpgme Gpgmepp
)
ecm_mark_as_test(messagecore-autocryptstoragetest)
add_gpg_crypto_test(autocryptstoragetest messagecore-autocryptstoragetest)
add_executable(autocryptutilstest
autocryptutilstest.cpp
../src/autocrypt/autocryptrecipient.cpp
)
target_link_libraries(autocryptutilstest
Qt5::Test
KF5::Libkleo KF5::MessageCore Qt5::Widgets
KF5::Archive KF5::Completion KF5::ConfigCore
KF5::CoreAddons KF5::Codecs KF5::MimeTreeParser
QGpgme Gpgmepp
)
ecm_mark_as_test(messagecore-autocryptutilstest)
add_gpg_crypto_test(autocryptutilstest messagecore-autocryptutilstest)
# Autocrypt tests
add_messagecore_cryptotest( autocryptrecipienttest.cpp )
add_messagecore_cryptotest( autocryptstoragetest.cpp )
add_messagecore_cryptotest( autocryptutilstest.cpp )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment