Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE PIM Add-ons
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
KDE PIM Add-ons
Commits
6a1a5a47
Commit
6a1a5a47
authored
Feb 02, 2018
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add autotest
parent
2aa76d39
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
185 additions
and
0 deletions
+185
-0
kmail/editorplugins/inserttemplatecommand/CMakeLists.txt
kmail/editorplugins/inserttemplatecommand/CMakeLists.txt
+16
-0
kmail/editorplugins/inserttemplatecommand/autotests/CMakeLists.txt
...torplugins/inserttemplatecommand/autotests/CMakeLists.txt
+13
-0
kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditorinterfacetest.cpp
...otests/inserttemplatecommandplugineditorinterfacetest.cpp
+43
-0
kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditorinterfacetest.h
...utotests/inserttemplatecommandplugineditorinterfacetest.h
+35
-0
kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditortest.cpp
...mmand/autotests/inserttemplatecommandplugineditortest.cpp
+43
-0
kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditortest.h
...command/autotests/inserttemplatecommandplugineditortest.h
+35
-0
No files found.
kmail/editorplugins/inserttemplatecommand/CMakeLists.txt
View file @
6a1a5a47
set
(
kmail_inserttemplatecommandeditorplugin_SRCS
inserttemplatecommandplugineditor.cpp
inserttemplatecommandplugineditorinterface.cpp
)
kcoreaddons_add_plugin
(
kmail_inserttemplatecommandeditorplugin JSON kmail_inserttemplatecommandeditorplugin.json SOURCES
${
kmail_inserttemplatecommandeditorplugin_SRCS
}
INSTALL_NAMESPACE kmail
)
target_link_libraries
(
kmail_inserttemplatecommandeditorplugin
KF5::IconThemes KF5::MessageComposer KF5::XmlGui KF5::I18n
)
if
(
BUILD_TESTING
)
add_subdirectory
(
autotests
)
endif
()
kmail/editorplugins/inserttemplatecommand/autotests/CMakeLists.txt
0 → 100644
View file @
6a1a5a47
macro
(
add_kmail_editorplugin_unittest _source _additional
)
set
(
_test
${
_source
}
${
_additional
}
)
get_filename_component
(
_name
${
_source
}
NAME_WE
)
add_executable
(
${
_name
}
${
_test
}
)
add_test
(
NAME
${
_name
}
COMMAND
${
_name
}
)
ecm_mark_as_test
(
kmail_editorplugin-
${
_name
}
)
target_link_libraries
(
${
_name
}
Qt5::Test KF5::XmlGui KF5::IconThemes KF5::MessageComposer KF5::I18n
)
endmacro
()
add_kmail_editorplugin_unittest
(
inserttemplatecommandplugineditortest.cpp
"../inserttemplatecommandplugineditor.cpp;../inserttemplatecommandplugineditorinterface.cpp"
)
add_kmail_editorplugin_unittest
(
inserttemplatecommandplugineditorinterfacetest.cpp
"../inserttemplatecommandplugineditorinterface.cpp"
)
kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditorinterfacetest.cpp
0 → 100644
View file @
6a1a5a47
/*
Copyright (C) 2018 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.
*/
#include "inserttemplatecommandplugineditorinterfacetest.h"
#include "../inserttemplatecommandplugineditorinterface.h"
#include <KActionCollection>
#include <QTest>
InsertTemplateCommandPluginEditorInterfaceTest
::
InsertTemplateCommandPluginEditorInterfaceTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
InsertTemplateCommandPluginEditorInterfaceTest
::~
InsertTemplateCommandPluginEditorInterfaceTest
()
{
}
void
InsertTemplateCommandPluginEditorInterfaceTest
::
shouldHaveDefaultValue
()
{
InsertTemplateCommandPluginEditorInterface
interface
(
nullptr
);
interface
.
createAction
(
new
KActionCollection
(
this
));
MessageComposer
::
ActionType
type
=
interface
.
actionType
();
QVERIFY
(
type
.
action
());
QCOMPARE
(
type
.
type
(),
MessageComposer
::
ActionType
::
Edit
);
}
QTEST_MAIN
(
InsertTemplateCommandPluginEditorInterfaceTest
)
kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditorinterfacetest.h
0 → 100644
View file @
6a1a5a47
/*
Copyright (C) 2018 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 InsertTemplateCommandPLUGINEDITORINTERFACETEST_H
#define InsertTemplateCommandPLUGINEDITORINTERFACETEST_H
#include <QObject>
class
InsertTemplateCommandPluginEditorInterfaceTest
:
public
QObject
{
Q_OBJECT
public:
explicit
InsertTemplateCommandPluginEditorInterfaceTest
(
QObject
*
parent
=
nullptr
);
~
InsertTemplateCommandPluginEditorInterfaceTest
();
private
Q_SLOTS
:
void
shouldHaveDefaultValue
();
};
#endif
kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditortest.cpp
0 → 100644
View file @
6a1a5a47
/*
Copyright (C) 2018 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.
*/
#include "inserttemplatecommandplugineditortest.h"
#include "../inserttemplatecommandplugineditor.h"
#include <KActionCollection>
#include <QTest>
InsertTemplateCommandPluginEditorTest
::
InsertTemplateCommandPluginEditorTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
InsertTemplateCommandPluginEditorTest
::~
InsertTemplateCommandPluginEditorTest
()
{
}
void
InsertTemplateCommandPluginEditorTest
::
shouldHaveDefaultValue
()
{
InsertTemplateCommandPluginEditor
plugin
;
QVERIFY
(
plugin
.
createInterface
(
new
KActionCollection
(
this
)));
QVERIFY
(
!
plugin
.
hasConfigureDialog
());
QVERIFY
(
!
plugin
.
hasPopupMenuSupport
());
QVERIFY
(
!
plugin
.
hasToolBarSupport
());
}
QTEST_MAIN
(
InsertTemplateCommandPluginEditorTest
)
kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditortest.h
0 → 100644
View file @
6a1a5a47
/*
Copyright (C) 2018 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 InsertTemplateCommandPLUGINEDITORTEST_H
#define InsertTemplateCommandPLUGINEDITORTEST_H
#include <QObject>
class
InsertTemplateCommandPluginEditorTest
:
public
QObject
{
Q_OBJECT
public:
explicit
InsertTemplateCommandPluginEditorTest
(
QObject
*
parent
=
nullptr
);
~
InsertTemplateCommandPluginEditorTest
();
private
Q_SLOTS
:
void
shouldHaveDefaultValue
();
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment