diff --git a/resources/maildir/libmaildir/tests/CMakeLists.txt b/resources/maildir/libmaildir/tests/CMakeLists.txt index 909bae7e38c61e2c4fffe02b0ed1fd8522907790..90e1ec9a60de2c5ca4d79bc4773b1a4794262986 100644 --- a/resources/maildir/libmaildir/tests/CMakeLists.txt +++ b/resources/maildir/libmaildir/tests/CMakeLists.txt @@ -1,3 +1,7 @@ +include(ECMAddTests) + +find_package(Qt5Test CONFIG REQUIRED) + set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) @@ -7,7 +11,9 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) set(testmaildir_SRCS testmaildir.cpp ) -kde4_add_unit_test(testmaildir TESTNAME maildir-testmaildir ${testmaildir_SRCS}) +add_executable( testmaildir ${testmaildir_SRCS} ) +add_test( testmaildir testmaildir ) +ecm_mark_as_test(maildir-testmaildir) target_link_libraries(testmaildir Qt5::Test KF5::AkonadiMime maildir) diff --git a/resources/shared/CMakeLists.txt b/resources/shared/CMakeLists.txt index fd8dc41ee4fa26a80e3aecff0e72f8b188f3f4a1..075f5e21e99832678727d094e74349202b04083e 100644 --- a/resources/shared/CMakeLists.txt +++ b/resources/shared/CMakeLists.txt @@ -1,3 +1,2 @@ add_subdirectory(filestore) -#REACTIVATE add_subdirectory(tests) diff --git a/resources/shared/filestore/CMakeLists.txt b/resources/shared/filestore/CMakeLists.txt index 3e6c5553ccaa439863ae6ab550ad7d334a0411a9..8e378de7d13153dc74667f7449c9114e11f9c6d3 100644 --- a/resources/shared/filestore/CMakeLists.txt +++ b/resources/shared/filestore/CMakeLists.txt @@ -31,8 +31,7 @@ set_target_properties(akonadi-filestore PROPERTIES VERSION ${KDEPIMRUNTIME_LIB_V install(TARGETS akonadi-filestore ${INSTALL_TARGETS_DEFAULT_ARGS}) -#reactivate -#if (KDE4_BUILD_TESTS) -# add_subdirectory( tests ) -#endif () +if (KDE4_BUILD_TESTS) + add_subdirectory( tests ) +endif () diff --git a/resources/shared/filestore/tests/CMakeLists.txt b/resources/shared/filestore/tests/CMakeLists.txt index 1c741456a1ce2610962968ed7240626ea879a9dc..9c2ab436971715853f6ce5f0b38337eeeae69c89 100644 --- a/resources/shared/filestore/tests/CMakeLists.txt +++ b/resources/shared/filestore/tests/CMakeLists.txt @@ -1,3 +1,7 @@ +include(ECMAddTests) + +find_package(Qt5Test CONFIG REQUIRED) + if(${EXECUTABLE_OUTPUT_PATH}) set( PREVIOUS_EXEC_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH} ) else() @@ -15,9 +19,13 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) -kde4_add_unit_test( abstractlocalstoretest abstractlocalstoretest.cpp ) +add_executable(abstractlocalstoretest abstractlocalstoretest.cpp) +add_test(abstractlocalstoretest abstractlocalstoretest) +ecm_mark_as_test(abstractlocalstoretest) + target_link_libraries( abstractlocalstoretest akonadi-filestore KF5::AkonadiCore + Qt5::Test ) diff --git a/resources/shared/filestore/tests/abstractlocalstoretest.cpp b/resources/shared/filestore/tests/abstractlocalstoretest.cpp index 74ed543ff620bb773889e094bbbfb1e9f1a5d535..935d923f78ed78ed40bdfea20986e9caba46b9b2 100644 --- a/resources/shared/filestore/tests/abstractlocalstoretest.cpp +++ b/resources/shared/filestore/tests/abstractlocalstoretest.cpp @@ -35,7 +35,7 @@ #include -#include +#include using namespace Akonadi; using namespace Akonadi::FileStore; @@ -962,7 +962,7 @@ void AbstractLocalStoreTest::testCompactStore() mStore->mErrorText = QString(); } -QTEST_KDEMAIN( AbstractLocalStoreTest, NoGUI ) +QTEST_MAIN( AbstractLocalStoreTest ) #include "abstractlocalstoretest.moc" diff --git a/resources/shared/tests/CMakeLists.txt b/resources/shared/tests/CMakeLists.txt index e6658e20ccf305cb97a356a30335f361baee54b9..ef8720ce4976ca38bc35422f3b68452241d2f1c3 100644 --- a/resources/shared/tests/CMakeLists.txt +++ b/resources/shared/tests/CMakeLists.txt @@ -1,7 +1,13 @@ +include(ECMAddTests) + +find_package(Qt5Test CONFIG REQUIRED) + macro(_add_test _source) set(_test ${_source}) get_filename_component(_name ${_source} NAME_WE) - kde4_add_unit_test(${_name} TESTNAME akonadi-${_name} ${_test}) + add_executable( ${_name} ${_test} ) + add_test( ${_name} ${_name} ) + ecm_mark_as_test(knotes-${_name}) target_link_libraries(${_name} Qt5::Test KF5::AkonadiCore KF5::Imap) endmacro() diff --git a/resources/shared/tests/collectionannotationattributetest.cpp b/resources/shared/tests/collectionannotationattributetest.cpp index 41fa7aa20e03153b2fbdae92d49cbffac25b825e..d62355675729456377b0774b5eae3e6b43874b12 100644 --- a/resources/shared/tests/collectionannotationattributetest.cpp +++ b/resources/shared/tests/collectionannotationattributetest.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include #include "../collectionannotationsattribute.cpp" typedef QMap Annotation; @@ -79,7 +79,7 @@ class CollectionAnnotationAttributeTest : public QObject }; -QTEST_KDEMAIN( CollectionAnnotationAttributeTest, NoGUI ) +QTEST_MAIN( CollectionAnnotationAttributeTest ) #include "collectionannotationattributetest.moc" diff --git a/resources/shared/tests/imapaclattributetest.cpp b/resources/shared/tests/imapaclattributetest.cpp index 7e65a6f1c85f904752523212f115d0cdc965b6b8..c37d4e699ae591e5e316b6efe82a22f7059d40d5 100644 --- a/resources/shared/tests/imapaclattributetest.cpp +++ b/resources/shared/tests/imapaclattributetest.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include #include "../imapaclattribute.cpp" using namespace Akonadi; @@ -105,6 +105,6 @@ class ImapAclAttributeTest : public QObject } }; -QTEST_KDEMAIN( ImapAclAttributeTest, NoGUI ) +QTEST_MAIN( ImapAclAttributeTest ) #include "imapaclattributetest.moc"