Commit 558f3588 authored by Laurent Montel's avatar Laurent Montel 😁

Port test to qt5

parent 5f245ee6
......@@ -8,7 +8,9 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/
macro( followupreminder_agent _source )
set( _test ${_source} )
get_filename_component( _name ${_source} NAME_WE )
kde4_add_unit_test( ${_name} TESTNAME followupreminder-${_name} ${_test} )
add_executable( ${_name} ${_test} )
add_test( ${_name} ${_name} )
ecm_mark_as_test(followupreminder-${_name})
target_link_libraries( ${_name} Qt5::Test KF5::AkonadiCore followupreminder)
endmacro()
......
......@@ -17,7 +17,7 @@
#include "followupreminderinfotest.h"
#include "../followupreminderinfo.h"
#include <qtest_kde.h>
#include <qtest.h>
FollowUpReminderInfoTest::FollowUpReminderInfoTest()
{
......@@ -51,4 +51,4 @@ void FollowUpReminderInfoTest::shoudBeNotValid()
QCOMPARE(info.isValid(), true);
}
QTEST_KDEMAIN(FollowUpReminderInfoTest, NoGUI)
QTEST_MAIN(FollowUpReminderInfoTest)
......@@ -14,6 +14,8 @@ target_link_libraries(dbustest KF5::KIOCore KF5::KDELibs4Support)
set( kmail_displaymenu_source displaymessageformatactionmenutest.cpp ../widgets/displaymessageformatactionmenu.cpp )
kde4_add_unit_test( displaymessageformatactionmenutest ${kmail_displaymenu_source})
add_executable( displaymessageformatactionmenutest ${kmail_displaymenu_source} )
add_test( displaymessageformatactionmenutest displaymessageformatactionmenutest )
ecm_mark_as_test(kmail-displaymessageformatactionmenutest)
target_link_libraries( displaymessageformatactionmenutest Qt5::Test messageviewer)
project(knotes)
add_subdirectory( icons )
#add_subdirectory( tests )
add_subdirectory( tests )
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
......
......@@ -2,17 +2,15 @@ add_subdirectory(apps)
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
include_directories(
)
include ( ${CMAKE_SOURCE_DIR}/cmake/modules/kde4_handle_crypto_rpath_for_executable.cmake )
# convenience macro to add qtest unit tests
macro(add_knotes_unittest _source)
set(_test ${_source} )
get_filename_component(_name ${_source} NAME_WE)
kde4_add_unit_test(${_name} TESTNAME knotes-${_name} ${_test} )
add_executable( ${_name} ${_test} )
add_test( ${_name} ${_name} )
ecm_mark_as_test(knotes-${_name})
target_link_libraries( ${_name}
Qt5::Test
KF5::KIOCore
......
......@@ -34,6 +34,8 @@
#include <QDebug>
#include <QHash>
#include <QTextEdit>
#include <QLineEdit>
KNotesAkonadiApp::KNotesAkonadiApp(QWidget *parent)
: QWidget(parent)
......
......@@ -30,7 +30,7 @@
KNotesAkonadiTray::KNotesAkonadiTray(Akonadi::ChangeRecorder *recorder, QWidget *parent)
: KStatusNotifierItem(parent),
mIcon(QLatin1String("knotes"))
mIcon(QIcon::fromTheme(QLatin1String("knotes")))
{
setToolTipTitle( i18n( "KNotes: Sticky notes for KDE" ) );
setToolTipIconByName( QLatin1String("knotes") );
......
......@@ -19,6 +19,7 @@
#define KNOTESAKONADITRAY_H
#include <KStatusNotifierItem>
#include <QIcon>
namespace Akonadi {
class ChangeRecorder;
}
......@@ -35,7 +36,7 @@ private Q_SLOTS:
void slotUpdateSystemTray();
private:
KIcon mIcon;
QIcon mIcon;
};
#endif // KNOTESAKONADITRAY_H
......@@ -16,11 +16,11 @@
*/
#include "notetest.h"
#include <qtest_kde.h>
#include <qtest.h>
NoteTest::NoteTest()
{
}
QTEST_KDEMAIN( NoteTest, GUI )
QTEST_MAIN( NoteTest )
......@@ -19,7 +19,7 @@
#include "../core/messageitem_p.h"
#include <qtest_kde.h>
#include <qtest.h>
#include <QObject>
using namespace MessageList::Core;
......@@ -42,6 +42,6 @@ class ItemSizeTest : public QObject
}
};
QTEST_KDEMAIN( ItemSizeTest, GUI )
QTEST_MAIN( ItemSizeTest )
#include "itemsizetest.moc"
......@@ -21,15 +21,14 @@
#include "quicksearchlinetest.h"
#include "messagelist/core/quicksearchline.h"
#include <qtest_kde.h>
#include <qtest.h>
#include <qtestkeyboard.h>
#include <qtestmouse.h>
#include <KLineEdit>
#include <QToolButton>
#include <QPushButton>
#include <QPushButton>
#include <KComboBox>
#include <QSignalSpy>
using namespace MessageList::Core;
QuickSearchLineTest::QuickSearchLineTest()
......@@ -280,4 +279,4 @@ void QuickSearchLineTest::shouldNotShowComboboxWhenWeAddNewItemWhenWeHiddedQuick
}
QTEST_KDEMAIN( QuickSearchLineTest, GUI )
QTEST_MAIN( QuickSearchLineTest )
......@@ -18,7 +18,8 @@
#include "textgotolinewidgettest.h"
#include "pimcommon/texteditor/commonwidget/textgotolinewidget.h"
#include <qtest_kde.h>
#include <qtest.h>
#include <QSignalSpy>
#include <qtestmouse.h>
#include <qtestkeyboard.h>
#include <QSpinBox>
......@@ -130,4 +131,4 @@ void TextGoToLineWidgetTest::shouldSetFocusWhenWeRecallGotToLine()
}
QTEST_KDEMAIN( TextGoToLineWidgetTest, GUI )
QTEST_MAIN( TextGoToLineWidgetTest )
......@@ -21,11 +21,11 @@
#include <QPushButton>
#include <qtest_kde.h>
#include <qtest.h>
#include <qtestkeyboard.h>
#include <qtestmouse.h>
#include <QComboBox>
#include <QSignalSpy>
TranslatorTest::TranslatorTest()
{
......@@ -118,4 +118,4 @@ void TranslatorTest::shouldEmitTranslatorWasClosedSignalWhenCloseIt()
QCOMPARE(spy.count(), 1);
}
QTEST_KDEMAIN( TranslatorTest, GUI )
QTEST_MAIN( TranslatorTest )
......@@ -20,7 +20,6 @@ macro(add_templateparser_unittest _source)
messageviewer
${QGPGME_LIBRARIES}
Qt5::Test
Qt5::WebKitWidgets
KF5::KIOCore
KF5::Mime
......
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