Add more autotest

wilder-work
Montel Laurent 11 years ago
parent 42fb83114b
commit 79745eede9
  1. 7
      CMakeLists.txt
  2. 8
      autotests/CMakeLists.txt
  3. 19
      migration/autotests/CMakeLists.txt
  4. 2
      migration/autotests/kmmigratekmail4configtest.cpp
  5. 0
      migration/autotests/kmmigratekmail4configtest.h
  6. 31
      migration/autotests/migrateinfotest.cpp
  7. 31
      migration/autotests/migrateinfotest.h
  8. 13
      migration/kmmigratekmail4config.h
  9. 58
      migration/migrateinfo.cpp
  10. 43
      migration/migrateinfo.h

@ -172,6 +172,10 @@ if (KDEPIM_BUILD_DESKTOP)
tag/tagactionmanager.cpp
tag/tagselectdialog.cpp
)
set(kmailprivate_migrate_LIB_SRCS
migration/kmmigratekmail4config.cpp
migration/migrateinfo.cpp
)
set(kmailprivate_LIB_SRCS
kmail_debug.cpp
kmmainwin.cpp
@ -193,7 +197,7 @@ if (KDEPIM_BUILD_DESKTOP)
foldershortcutactionmanager.cpp
kmlaunchexternalcomponent.cpp
manageshowcollectionproperties.cpp
migration/kmmigratekmail4config.cpp
${kmailprivate_migrate_LIB_SRCS}
${kmailprivate_attributes_LIB_SRCS}
${kmailprivate_tag_LIB_SRCS}
${kmailprivate_job_LIB_SRCS}
@ -351,6 +355,7 @@ generate_export_header(kmailprivate BASE_NAME kmail)
add_subdirectory(mailmerge/autotests/)
add_subdirectory(folderarchive/autotests/)
add_subdirectory(editor/potentialphishingemail/autotests)
add_subdirectory(migration/autotests/)
endif()
########### install files ###############

@ -68,11 +68,3 @@ set(KDEPIMLIBS_RUN_SQLITE_ISOLATED_TESTS TRUE)
add_akonadi_isolated_test_advanced( tagselectdialogtest.cpp "../tag/tagselectdialog.cpp;../kmail_debug.cpp" "${KDEPIMLIBS_AKONADI_LIBS};kmailprivate;mailcommon")
set( kmail_migratekmail4configtest_source kmmigratekmail4configtest.cpp ../migration/kmmigratekmail4config.cpp)
add_executable(migratekmail4configtest ${kmail_migratekmail4configtest_source})
ecm_mark_as_test(kmail-migratekmail4configtest)
target_link_libraries( migratekmail4configtest Qt5::Test )

@ -0,0 +1,19 @@
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
include_directories(
BEFORE
${CMAKE_SOURCE_DIR}/kmail
${CMAKE_BINARY_DIR}/kmail
)
set( kmail_migratekmail4configtest_source kmmigratekmail4configtest.cpp ../kmmigratekmail4config.cpp ../migrateinfo.cpp)
add_executable(migratekmail4configtest ${kmail_migratekmail4configtest_source})
ecm_mark_as_test(kmail-migratekmail4configtest)
target_link_libraries( migratekmail4configtest Qt5::Test )
set( kmail_migrateinfotest_source migrateinfotest.cpp ../migrateinfo.cpp)
add_executable(migrateinfotest ${kmail_migrateinfotest_source})
ecm_mark_as_test(kmail-migrateinfotest)
target_link_libraries( migrateinfotest Qt5::Test )

@ -16,7 +16,7 @@
*/
#include "kmmigratekmail4configtest.h"
#include "../migration/kmmigratekmail4config.h"
#include "../kmmigratekmail4config.h"
#include <qtest.h>
KMMigrateKMail4ConfigTest::KMMigrateKMail4ConfigTest(QObject *parent)

@ -0,0 +1,31 @@
/*
Copyright (c) 2015 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, version 2, as
published by the Free Software Foundation.
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; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "migrateinfotest.h"
#include <qtest.h>
MigrateInfoTest::MigrateInfoTest(QObject *parent)
{
}
MigrateInfoTest::~MigrateInfoTest()
{
}
QTEST_MAIN(MigrateInfoTest)

@ -0,0 +1,31 @@
/*
Copyright (c) 2015 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, version 2, as
published by the Free Software Foundation.
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; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef MIGRATEINFOTEST_H
#define MIGRATEINFOTEST_H
#include <QObject>
class MigrateInfoTest : public QObject
{
Q_OBJECT
public:
explicit MigrateInfoTest(QObject *parent = Q_NULLPTR);
~MigrateInfoTest();
};
#endif // MIGRATEINFOTEST_H

@ -20,18 +20,7 @@
#include <QObject>
#include <QVector>
struct MigrateInfo
{
MigrateInfo()
: folder(false)
{
}
QString type;
QString path;
bool folder;
};
#include "migrateinfo.h"
class KMMigrateKMail4Config : public QObject
{

@ -0,0 +1,58 @@
/*
Copyright (c) 2015 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, version 2, as
published by the Free Software Foundation.
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; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "migrateinfo.h"
MigrateInfo::MigrateInfo()
: mFolder(false)
{
}
QString MigrateInfo::type() const
{
return mType;
}
void MigrateInfo::setType(const QString &type)
{
mType = type;
}
QString MigrateInfo::path() const
{
return mPath;
}
void MigrateInfo::setPath(const QString &path)
{
mPath = path;
}
bool MigrateInfo::folder() const
{
return mFolder;
}
void MigrateInfo::setFolder(bool folder)
{
mFolder = folder;
}

@ -0,0 +1,43 @@
/*
Copyright (c) 2015 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, version 2, as
published by the Free Software Foundation.
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; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef MIGRATEINFO_H
#define MIGRATEINFO_H
#include <QString>
class MigrateInfo
{
public:
MigrateInfo();
QString type() const;
void setType(const QString &type);
QString path() const;
void setPath(const QString &path);
bool folder() const;
void setFolder(bool folder);
private:
QString mType;
QString mPath;
bool mFolder;
};
#endif // MIGRATEINFO_H
Loading…
Cancel
Save