CMakeLists.txt 1.72 KB
Newer Older
1
2
add_subdirectory(gnupg_home)

3
4
5
add_definitions( -DMAIL_DATA_DIR="${CMAKE_SOURCE_DIR}/mimetreeparser/autotests/data" )
add_definitions( -DDATA_DIR="${CMAKE_SOURCE_DIR}/messagecore/autotests/data" )

6
7
8
9
10
# Convenience macro to add unit tests.
macro(add_messagecore_test _source )
    add_definitions(-DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
    ecm_add_test(${_source}
        NAME_PREFIX "messagecore-"
11
        LINK_LIBRARIES Qt::Test KF5::Libkleo KF5::MessageCore Qt::Widgets KF5::Archive KF5::Completion KF5::ConfigCore KF5::CoreAddons
12
13
14
    )
endmacro()

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
31
32
        Qt::Test
        Qt::Widgets
33
34
35
36
        )
    add_gpg_crypto_test(${_name} messagecore-${_name})
endmacro()

37
38
39
40
41
42
43
44
45
46
47
# Attachment tests.
add_messagecore_test( attachmentcompressjobtest.cpp )
add_messagecore_test( attachmentfrommimecontentjobtest.cpp )
add_messagecore_test( attachmentfromurljobtest.cpp )
add_messagecore_test( attachmentparttest.cpp )
add_messagecore_test( attachmentpropertiesdialogtest.cpp )
add_messagecore_test( attachmentupdatejobtest.cpp )

# Other tests
add_messagecore_test( stringutiltest.cpp )
add_messagecore_test( mailinglisttest.cpp )
48

49
50
51
52
# Autocrypt tests
add_messagecore_cryptotest( autocryptrecipienttest.cpp )
add_messagecore_cryptotest( autocryptstoragetest.cpp )
add_messagecore_cryptotest( autocryptutilstest.cpp )