Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit f301d7d0 authored by Laurent Montel's avatar Laurent Montel 😁

Start to create autotest

parent 8bdb6516
......@@ -82,8 +82,10 @@ set_package_properties(Boost PROPERTIES
if(BUILD_TESTING)
set(AKONADI_TESTS_EXPORT AKONADICORE_EXPORT)
set(AKONADIWIDGET_TESTS_EXPORT AKONADIWIDGETS_EXPORT)
endif()
configure_file(akonaditests_export.h.in "${CMAKE_CURRENT_BINARY_DIR}/akonaditests_export.h")
configure_file(akonadiwidgetstests_export.h.in "${CMAKE_CURRENT_BINARY_DIR}/akonadiwidgetstests_export.h")
# Make sure the KF5Akonadi_DATA_DIR is absolute before passing it to KF5AkonadiConfig.cmake.in
# otherwise build fails either on OSX CI, or for normal users
......
#include "akonadiwidgets_export.h"
#define AKONADIWIDGET_TESTS_EXPORT @AKONADIWIDGET_TESTS_EXPORT@
......@@ -105,6 +105,7 @@ add_akonadi_test(proxymodelstest.cpp)
add_akonadi_test(newmailnotifierattributetest.cpp)
add_akonadi_test(pop3resourceattributetest.cpp)
add_akonadi_test_widgets(actionstatemanagertest.cpp)
add_akonadi_test_widgets(conflictresolvedialogtest.cpp)
add_akonadi_test(tagmodeltest.cpp)
add_akonadi_test(statisticsproxymodeltest.cpp)
......
/*
Copyright (c) 2017 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include "conflictresolvedialogtest.h"
#include "../src/widgets/conflictresolvedialog_p.h"
#include <QLabel>
#include <QPushButton>
#include <QTest>
#include <QTextBrowser>
QTEST_MAIN(ConflictResolveDialogTest)
ConflictResolveDialogTest::ConflictResolveDialogTest(QObject *parent)
: QObject(parent)
{
}
void ConflictResolveDialogTest::shouldHaveDefaultValues()
{
Akonadi::ConflictResolveDialog dlg;
QVERIFY(!dlg.windowTitle().isEmpty());
QPushButton *takeLeftButton = dlg.findChild<QPushButton *>(QStringLiteral("takeLeftButton"));
QVERIFY(takeLeftButton);
QVERIFY(!takeLeftButton->text().isEmpty());
QPushButton *takeRightButton = dlg.findChild<QPushButton *>(QStringLiteral("takeRightButton"));
QVERIFY(takeRightButton);
QVERIFY(!takeRightButton->text().isEmpty());
QPushButton *keepBothButton = dlg.findChild<QPushButton *>(QStringLiteral("keepBothButton"));
QVERIFY(keepBothButton);
QVERIFY(!keepBothButton->text().isEmpty());
QVERIFY(keepBothButton->isDefault());
QTextBrowser *mView = dlg.findChild<QTextBrowser *>(QStringLiteral("view"));
QVERIFY(mView);
QVERIFY(mView->toPlainText().isEmpty());
QLabel *docuLabel = dlg.findChild<QLabel *>(QStringLiteral("doculabel"));
QVERIFY(docuLabel);
QVERIFY(!docuLabel->text().isEmpty());
QPushButton *openEditorButton = dlg.findChild<QPushButton *>(QStringLiteral("openEditorButton"));
QVERIFY(openEditorButton);
QVERIFY(!openEditorButton->text().isEmpty());
}
/*
Copyright (c) 2017 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef CONFLICTRESOLVEDIALOGTEST_H
#define CONFLICTRESOLVEDIALOGTEST_H
#include <QObject>
class ConflictResolveDialogTest : public QObject
{
Q_OBJECT
public:
explicit ConflictResolveDialogTest(QObject *parent = nullptr);
~ConflictResolveDialogTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValues();
};
#endif // CONFLICTRESOLVEDIALOGTEST_H
......@@ -134,6 +134,7 @@ install(FILES
DESTINATION ${ECM_MKSPECS_INSTALL_DIR}
)
######### Build and install QtDesigner plugin #############
if (KF5DesignerPlugin_FOUND)
......
......@@ -24,6 +24,7 @@
#include <QDialog>
#include "conflicthandler_p.h"
#include "akonadiwidgetstests_export.h"
class QTextBrowser;
......@@ -35,7 +36,7 @@ namespace Akonadi
*
* @author Tobias Koenig <tokoe@kde.org>
*/
class ConflictResolveDialog : public QDialog
class AKONADIWIDGET_TESTS_EXPORT ConflictResolveDialog : public QDialog
{
Q_OBJECT
......
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