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 6602af39 authored by Laurent Montel's avatar Laurent Montel 😁

Reactivate autotest

parent f2c3958b
#macro(add_messageviewer_dkim_verify_unittest _source)
# get_filename_component(_name ${_source} NAME_WE)
# ecm_add_test(${_source}
# TEST_NAME ${_name}
# NAME_PREFIX "messageviewer-"
# LINK_LIBRARIES KF5::MessageViewer KF5::WebEngineViewer KF5::Libkleo QGpgme Qt5::Test
# )
#endmacro ()
macro(add_messageviewer_dkim_verify_unittest _source)
get_filename_component(_name ${_source} NAME_WE)
ecm_add_test(${_source}
TEST_NAME ${_name}
NAME_PREFIX "messageviewer-"
LINK_LIBRARIES KF5::MessageViewer dkimverifyconfigure Qt5::Test
)
endmacro ()
#add_messageviewer_dkim_verify_unittest(dkiminfotest.cpp)
add_messageviewer_dkim_verify_unittest(dkimconfiguredialogtest.cpp)
add_messageviewer_dkim_verify_unittest(dkimconfiguretabtest.cpp)
add_messageviewer_dkim_verify_unittest(dkimconfiguretabwidgettest.cpp)
add_messageviewer_dkim_verify_unittest(dkimconfigurewidgettest.cpp)
......@@ -18,8 +18,8 @@
*/
#include "dkimconfiguredialogtest.h"
#include "dkim-verify/dkimconfiguredialog.h"
#include "dkim-verify/dkimconfigurewidget.h"
#include "../dkimconfiguredialog.h"
#include "../dkimconfigurewidget.h"
#include <QTest>
#include <QStandardPaths>
#include <QVBoxLayout>
......@@ -35,12 +35,12 @@ DKIMConfigureDialogTest::DKIMConfigureDialogTest(QObject *parent)
void DKIMConfigureDialogTest::shouldHaveDefaultValue()
{
MessageViewer::DKIMConfigureDialog dlg;
DKIMConfigureDialog dlg;
QVBoxLayout *mainLayout = dlg.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
MessageViewer::DKIMConfigureWidget *mConfigureWidget = dlg.findChild<MessageViewer::DKIMConfigureWidget *>(QStringLiteral("mConfigureWidget"));
DKIMConfigureWidget *mConfigureWidget = dlg.findChild<DKIMConfigureWidget *>(QStringLiteral("mConfigureWidget"));
QVERIFY(mConfigureWidget);
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonBox"));
......
......@@ -18,7 +18,8 @@
*/
#include "dkimconfiguretabtest.h"
#include "dkim-verify/dkimconfiguretab.h"
#include "../dkimconfiguretab.h"
#include "kdepimtest_layout.h"
#include <QHBoxLayout>
#include <QTabWidget>
#include <QTest>
......@@ -31,11 +32,11 @@ DKIMConfigureTabTest::DKIMConfigureTabTest(QObject *parent)
void DKIMConfigureTabTest::shouldHaveDefaultValue()
{
MessageViewer::DKIMConfigureTab w;
DKIMConfigureTab w;
QHBoxLayout *mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
QTabWidget *mTabWidget = w.findChild<QTabWidget *>(QStringLiteral("tabwidget"));
QVERIFY(mTabWidget);
......
......@@ -18,7 +18,8 @@
*/
#include "dkimconfiguretabwidgettest.h"
#include "dkim-verify/dkimconfiguretabwidget.h"
#include "../dkimconfiguretabwidget.h"
#include "kdepimtest_layout.h"
#include <QTabWidget>
#include <QTest>
#include <QVBoxLayout>
......@@ -32,9 +33,9 @@ DKIMConfigureTabWidgetTest::DKIMConfigureTabWidgetTest(QObject *parent)
void DKIMConfigureTabWidgetTest::shouldHaveDefaultValue()
{
MessageViewer::DKIMConfigureTabWidget w;
DKIMConfigureTabWidget w;
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
}
......@@ -18,8 +18,9 @@
*/
#include "dkimconfigurewidgettest.h"
#include "dkim-verify/dkimconfigurewidget.h"
#include "dkim-verify/dkimconfiguretab.h"
#include "../dkimconfigurewidget.h"
#include "../dkimconfiguretab.h"
#include "kdepimtest_layout.h"
#include <QTest>
#include <QVBoxLayout>
......@@ -32,11 +33,11 @@ DKIMConfigureWidgetTest::DKIMConfigureWidgetTest(QObject *parent)
void DKIMConfigureWidgetTest::shouldHaveDefaultValue()
{
MessageViewer::DKIMConfigureWidget w;
DKIMConfigureWidget w;
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
MessageViewer::DKIMConfigureTab *mTabWidget = w.findChild<MessageViewer::DKIMConfigureTab *>(QStringLiteral("tabwidget"));
DKIMConfigureTab *mTabWidget = w.findChild<DKIMConfigureTab *>(QStringLiteral("tabwidget"));
QVERIFY(mTabWidget);
}
/*
Copyright (C) 2019 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KDEPIMTEST_LAYOUT_H
#define KDEPIMTEST_LAYOUT_H
#include <QTest>
#include <QLayout>
namespace KdepimTestLayout
{
void checkContentsMargins(int margin, QLayout *layout)
{
int top = -1;
int bottom = -1;
int left = -1;
int right = -1;
layout->getContentsMargins(&left, &top, &right, &bottom);
QCOMPARE(top, margin);
QCOMPARE(left, margin);
QCOMPARE(bottom, margin);
QCOMPARE(right, margin);
}
}
#endif
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