summaryrefslogtreecommitdiffstats
path: root/accounts/maildir
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-15 09:17:48 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-15 09:17:48 +0100
commita324759edfd9d3470aa4dc5a6e5e966682cd70c2 (patch)
tree9e560ebde564d62bf374f30aeb4cdd3d8414a7ca /accounts/maildir
parentbf039428e22a10887e8d85a95ff5f38dc17e7ec2 (diff)
downloadkube-a324759edfd9d3470aa4dc5a6e5e966682cd70c2.tar.gz
kube-a324759edfd9d3470aa4dc5a6e5e966682cd70c2.zip
Prepared a settingstest
Diffstat (limited to 'accounts/maildir')
-rw-r--r--accounts/maildir/CMakeLists.txt5
-rw-r--r--accounts/maildir/tests/CMakeLists.txt6
-rw-r--r--accounts/maildir/tests/settingstest.cpp37
3 files changed, 48 insertions, 0 deletions
diff --git a/accounts/maildir/CMakeLists.txt b/accounts/maildir/CMakeLists.txt
index eafd430f..bc9854d5 100644
--- a/accounts/maildir/CMakeLists.txt
+++ b/accounts/maildir/CMakeLists.txt
@@ -37,6 +37,11 @@ add_library(maildiraccountplugin SHARED ${SRCS})
37qt5_use_modules(maildiraccountplugin Core Quick Qml) 37qt5_use_modules(maildiraccountplugin Core Quick Qml)
38target_link_libraries(maildiraccountplugin sink settingsplugin) 38target_link_libraries(maildiraccountplugin sink settingsplugin)
39 39
40add_library(maildiraccount_static STATIC ${SRCS})
41qt5_use_modules(maildiraccount_static Core Quick Qml)
42target_link_libraries(maildiraccount_static sink settingsplugin)
43add_subdirectory(tests)
44
40kpackage_install_package(package org.kube.accounts.maildir "genericqml") 45kpackage_install_package(package org.kube.accounts.maildir "genericqml")
41 46
42install(TARGETS maildiraccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/maildir) 47install(TARGETS maildiraccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/maildir)
diff --git a/accounts/maildir/tests/CMakeLists.txt b/accounts/maildir/tests/CMakeLists.txt
new file mode 100644
index 00000000..cc7651b3
--- /dev/null
+++ b/accounts/maildir/tests/CMakeLists.txt
@@ -0,0 +1,6 @@
1include_directories(../)
2cmake_policy(SET CMP0063 NEW)
3add_executable(settingstest settingstest.cpp)
4add_test(settingstest settingstest)
5qt5_use_modules(settingstest Core Test Concurrent)
6target_link_libraries(settingstest sink maildiraccount_static)
diff --git a/accounts/maildir/tests/settingstest.cpp b/accounts/maildir/tests/settingstest.cpp
new file mode 100644
index 00000000..d9983028
--- /dev/null
+++ b/accounts/maildir/tests/settingstest.cpp
@@ -0,0 +1,37 @@
1#include <QtTest>
2#include <QDebug>
3#include <functional>
4
5#include "maildirsettings.h"
6
7class SettingsTest : public QObject
8{
9 Q_OBJECT
10private slots:
11
12 void initTestCase()
13 {
14 // Sink::FacadeFactory::instance().resetFactory();
15 // ResourceConfig::clear();
16 // Sink::Log::setDebugOutputLevel(Sink::Log::Trace);
17 }
18
19 void testLoad()
20 {
21 auto accountId = "accountid";
22 auto maildirPath = QDir::tempPath();
23
24 MaildirSettings settings;
25 settings.setAccountIdentifier(accountId);
26 settings.setPath(maildirPath);
27 settings.save();
28
29 //TODO ensure the maildir resource has been created
30 //TODO ensure the path has been setup correctly
31 //Ensure we can read the configuration correctly
32 //Ensure we can remove the account again
33 }
34};
35
36QTEST_GUILESS_MAIN(SettingsTest)
37#include "settingstest.moc"