Commit bb840dba authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add autotest

parent ed6b2278
####
set( utilstest_SRCS utilstest.cpp )
add_executable( utilstest ${utilstest_SRCS})
add_test(NAME utilstest COMMAND utilstest)
ecm_mark_as_test(utilstest)
target_link_libraries( utilstest Qt5::Test pimdataexporterprivate KF5::ConfigCore)
#####
set( resourceconverterclasstest_SRCS resourceconverterclasstest.cpp resourceconvertertest.cpp )
add_executable( resourceconverterclasstest ${resourceconverterclasstest_SRCS})
add_test(NAME resourceconverterclasstest COMMAND resourceconverterclasstest)
ecm_mark_as_test(resourceconverterclasstest)
target_link_libraries( resourceconverterclasstest Qt5::Test KF5::ConfigCore pimdataexporterprivate)
add_subdirectory(notes)
add_subdirectory(calendar)
/*
Copyright (C) 2020 Laurent Montel <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 "resourceconverterclasstest.h"
#include "resourceconvertertest.h"
#include "../utils.h"
#include <QTest>
QTEST_MAIN(ResourceConverterClassTest)
ResourceConverterClassTest::ResourceConverterClassTest(QObject *parent)
: QObject(parent)
{
}
void ResourceConverterClassTest::shouldGetAgentFileName()
{
ResourceConverterTest w;
const QString filename = Utils::resourcesPath() + QStringLiteral("akonadi_imap_resource_0rc");
QCOMPARE(w.agentFileName(filename), QStringLiteral("resources/agent_config_akonadi_imap_resource_0"));
}
/*
Copyright (C) 2020 Laurent Montel <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 RESOURCECONVERTERCLASSTEST_H
#define RESOURCECONVERTERCLASSTEST_H
#include <QObject>
class ResourceConverterClassTest : public QObject
{
Q_OBJECT
public:
explicit ResourceConverterClassTest(QObject *parent = nullptr);
~ResourceConverterClassTest() = default;
private Q_SLOTS:
void shouldGetAgentFileName();
};
#endif // RESOURCECONVERTERCLASSTEST_H
......@@ -42,9 +42,3 @@ void UtilsTest::shouldTestValue()
QCOMPARE(Utils::notePath(), QStringLiteral("note/"));
}
void UtilsTest::shouldGetAgentFileName()
{
//TODO
// const QString filename = Utils::resourcesPath() + QStringLiteral("akonadi_imap_resource_0rc");
// QCOMPARE(Utils::agentFileName(filename), QStringLiteral("resources/agent_config_akonadi_imap_resource_0"));
}
......@@ -30,7 +30,6 @@ public:
~UtilsTest() = default;
private Q_SLOTS:
void shouldTestValue();
void shouldGetAgentFileName();
};
#endif // UTILSTEST_H
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