summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-07-04 10:32:33 +0200
committerMontel Laurent <[email protected]>2017-07-04 10:32:33 +0200
commit297f0618b8b064c85a96c88ac410ad78414dbfd5 (patch)
treee9710380fc41a5ce1a7915677b3da3ca2876b3ce
parent732372e3a8e65e8c0a9447072dd65bf0dc26eff7 (diff)
USe akonadi macro for theses autotest
-rw-r--r--resources/maildir/autotests/CMakeLists.txt41
-rw-r--r--resources/pop3/autotests/CMakeLists.txt51
2 files changed, 14 insertions, 78 deletions
diff --git a/resources/maildir/autotests/CMakeLists.txt b/resources/maildir/autotests/CMakeLists.txt
index 21575ad..abed006 100644
--- a/resources/maildir/autotests/CMakeLists.txt
+++ b/resources/maildir/autotests/CMakeLists.txt
@@ -2,44 +2,9 @@ include(ECMMarkAsTest)
find_package(Qt5Test CONFIG REQUIRED)
-set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
-
-# Stolen from kdepimlibs/akonadi/tests
-macro(add_akonadi_isolated_test _source)
- get_filename_component(_targetName ${_source} NAME_WE)
- set(_srcList ${_source} )
-
- add_executable(${_targetName} ${_srcList})
- ecm_mark_as_test(${_targetName})
- target_link_libraries(${_targetName}
- Qt5::Test
- KF5::AkonadiCore
- KF5::AkonadiMime
- KF5::MailTransport
- KF5::Mime
- Qt5::DBus
- Qt5::Widgets
- )
-
- # based on kde4_add_unit_test
- if (WIN32)
- get_target_property( _loc ${_targetName} LOCATION )
- set(_executable ${_loc}.bat)
- else ()
- set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_targetName})
- endif ()
- if (UNIX)
- set(_executable ${_executable}.shell)
- endif ()
-
- find_program(_testrunner akonaditest)
-
- if (KDEPIM_RUN_ISOLATED_TESTS)
- add_test( maildir-${_targetName} ${_testrunner} -c ${CMAKE_CURRENT_SOURCE_DIR}/unittestenv/config.xml ${_executable} )
- endif ()
-endmacro(add_akonadi_isolated_test)
-
-
+set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
+set(KDEPIMLIBS_RUN_ISOLATED_TESTS TRUE)
+set(KDEPIMLIBS_RUN_SQLITE_ISOLATED_TESTS TRUE)
add_akonadi_isolated_test( synctest.cpp )
akonadi_add_resourcetest( maildir maildir.js )
diff --git a/resources/pop3/autotests/CMakeLists.txt b/resources/pop3/autotests/CMakeLists.txt
index c53ec01..cd4322c 100644
--- a/resources/pop3/autotests/CMakeLists.txt
+++ b/resources/pop3/autotests/CMakeLists.txt
@@ -8,46 +8,17 @@ include_directories(
# Stolen from kdepimlibs/akonadi/tests
kde_enable_exceptions()
-macro(add_akonadi_isolated_test _source)
- get_filename_component(_targetName ${_source} NAME_WE)
- set(_srcList ${_source} fakeserver/fakeserver.cpp)
+set(_srcList ${_source} fakeserver/fakeserver.cpp)
- kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/../settings.kcfg org.kde.Akonadi.POP3.Settings)
- set(pop3settingsinterface_xml ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.POP3.Settings.xml)
- kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/../../maildir/maildirresource.kcfg org.kde.Akonadi.Maildir.Settings)
- set(maildirsettingsinterface_xml ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Maildir.Settings.xml)
- set_source_files_properties(${pop3settingsinterface_xml} PROPERTIES INCLUDE "../metatype.h")
- qt5_add_dbus_interface(_srcList ${pop3settingsinterface_xml} pop3settings)
- qt5_add_dbus_interface(_srcList ${maildirsettingsinterface_xml} maildirsettings)
- # add the dbus interace to every test (easier than adding to particular tests only)
- #qt5_add_dbus_interface(_srcList ../org.kde.krss.xml krssinterface)
+kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/../settings.kcfg org.kde.Akonadi.POP3.Settings)
+set(pop3settingsinterface_xml ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.POP3.Settings.xml)
+kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/../../maildir/maildirresource.kcfg org.kde.Akonadi.Maildir.Settings)
+set(maildirsettingsinterface_xml ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Maildir.Settings.xml)
+set_source_files_properties(${pop3settingsinterface_xml} PROPERTIES INCLUDE "../metatype.h")
+qt5_add_dbus_interface(_srcList ${pop3settingsinterface_xml} pop3settings)
+qt5_add_dbus_interface(_srcList ${maildirsettingsinterface_xml} maildirsettings)
+# add the dbus interace to every test (easier than adding to particular tests only)
+#qt5_add_dbus_interface(_srcList ../org.kde.krss.xml krssinterface)
- add_executable(${_targetName} ${_srcList})
- target_link_libraries(${_targetName}
- Qt5::Test
- KF5::AkonadiCore
- KF5::Mime
- Qt5::Network
- Qt5::Widgets
- Qt5::DBus
- )
- # based on kde4_add_unit_test
- if (WIN32)
- get_target_property( _loc ${_targetName} LOCATION )
- set(_executable ${_loc}.bat)
- else ()
- set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_targetName})
- endif ()
- if (UNIX)
- set(_executable ${_executable}.shell)
- endif ()
-
- find_program(_testrunner akonaditest)
-
- if (KDEPIM_RUN_ISOLATED_TESTS)
- add_test( ${_targetName} ${_testrunner} -c ${CMAKE_CURRENT_SOURCE_DIR}/unittestenv/config.xml ${_executable} )
- endif ()
-endmacro(add_akonadi_isolated_test)
-
-add_akonadi_isolated_test(pop3test.cpp)
+add_akonadi_isolated_test_advanced(pop3test.cpp "${_srcList}" "KF5::Mime")