Commit d15c45aa authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Simplify the env for isolated Akonadi tests

parent 2ef2c35d
......@@ -30,6 +30,7 @@ set(KMAILTRANSPORT_LIB_VERSION ${PIM_VERSION})
set(KMIME_LIB_VERSION "5.5.80")
set(AKONADI_LIB_VERSION "5.5.80")
set(AKONADIMIME_LIB_VERSION "5.5.80")
set(KSMTP_LIB_VERSION "5.5.80")
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MailTransport")
########### Find packages ###########
......@@ -42,6 +43,7 @@ find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KPimSMTP ${KSMTP_LIB_VERSION} CONFIG REQUIRED)
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
......
include(ECMMarkAsTest)
find_package(Qt5Test CONFIG REQUIRED)
macro(add_akonadi_isolated_test _source _path)
get_filename_component(_targetName ${_source} NAME_WE)
set(_srcList ${_source} )
add_executable(${_targetName} ${_srcList})
target_link_libraries(${_targetName}
Qt5::Test
KF5::AkonadiCore
KF5::AkonadiMime
KF5::MailTransportAkonadi
KF5::Mime
KF5::I18n
KF5::ConfigGui
Qt5::Widgets
)
# based on kde4_add_unit_test
if (WIN32)
set(_executable $<TARGET_FILE_DIR:${_targetName}>/${_targetName}.bat)
else()
set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_targetName})
endif()
if (UNIX)
set(_executable ${_executable}.shell)
endif()
find_program(_testrunner akonaditest)
if (KDEPIMLIBS_RUN_ISOLATED_TESTS)
add_test( mailtransport-${_targetName} ${_testrunner} -c ${CMAKE_CURRENT_SOURCE_DIR}/${_path}/config.xml ${_executable} )
endif()
endmacro(add_akonadi_isolated_test)
find_package(KF5DBusAddons CONFIG REQUIRED)
# Akonadi testrunner-based tests:
add_akonadi_isolated_test(
SOURCE attributetest.cpp
LINK_LIBRARIES KF5::MailTransportAkonadi
)
add_akonadi_isolated_test(
SOURCE messagequeuejobtest.cpp
LINK_LIBRARIES KF5::MailTransportAkonadi KF5::I18n KF5::ConfigGui
)
# TODO: port & re-enable
#add_akonadi_isolated_test(
# SOURCE filteractiontest.cpp
# LINK_LIBRARIES KF5::AkonadiCore KF5::MailTransportAkonadi
#)
add_akonadi_isolated_test( attributetest.cpp unittestenv )
add_akonadi_isolated_test( messagequeuejobtest.cpp unittestenv )
MESSAGE(STATUS "REACTIVATE IT")
if (KDEPIMLIBS_RUN_KDEPIMRUNTIME_ISOLATED_TESTS)
add_akonadi_isolated_test( filteractiontest.cpp unittestenv_akonadi )
endif()
<config>
<kdehome>kdehome</kdehome>
<confighome>xdgconfig</confighome>
<datahome>xdglocal</datahome>
</config>
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