Commit 8051fa17 authored by Laurent Montel's avatar Laurent Montel 😁

Port tests

parent ace576f9
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)
add_subdirectory(filestore)
#REACTIVATE
add_subdirectory(tests)
......@@ -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 ()
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
)
......@@ -35,7 +35,7 @@
#include <KRandom>
#include <qtest_kde.h>
#include <qtest.h>
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"
......
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()
......
......@@ -18,7 +18,7 @@
*/
#include <QtTest>
#include <qtest_kde.h>
#include <qtest.h>
#include "../collectionannotationsattribute.cpp"
typedef QMap<QByteArray, QByteArray> Annotation;
......@@ -79,7 +79,7 @@ class CollectionAnnotationAttributeTest : public QObject
};
QTEST_KDEMAIN( CollectionAnnotationAttributeTest, NoGUI )
QTEST_MAIN( CollectionAnnotationAttributeTest )
#include "collectionannotationattributetest.moc"
......@@ -18,7 +18,7 @@
*/
#include <QtTest>
#include <qtest_kde.h>
#include <qtest.h>
#include "../imapaclattribute.cpp"
using namespace Akonadi;
......@@ -105,6 +105,6 @@ class ImapAclAttributeTest : public QObject
}
};
QTEST_KDEMAIN( ImapAclAttributeTest, NoGUI )
QTEST_MAIN( ImapAclAttributeTest )
#include "imapaclattributetest.moc"
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