diff options
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/maildir/CMakeLists.txt | 5 | ||||
-rw-r--r-- | accounts/maildir/tests/CMakeLists.txt | 6 | ||||
-rw-r--r-- | accounts/maildir/tests/settingstest.cpp | 37 |
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}) | |||
37 | qt5_use_modules(maildiraccountplugin Core Quick Qml) | 37 | qt5_use_modules(maildiraccountplugin Core Quick Qml) |
38 | target_link_libraries(maildiraccountplugin sink settingsplugin) | 38 | target_link_libraries(maildiraccountplugin sink settingsplugin) |
39 | 39 | ||
40 | add_library(maildiraccount_static STATIC ${SRCS}) | ||
41 | qt5_use_modules(maildiraccount_static Core Quick Qml) | ||
42 | target_link_libraries(maildiraccount_static sink settingsplugin) | ||
43 | add_subdirectory(tests) | ||
44 | |||
40 | kpackage_install_package(package org.kube.accounts.maildir "genericqml") | 45 | kpackage_install_package(package org.kube.accounts.maildir "genericqml") |
41 | 46 | ||
42 | install(TARGETS maildiraccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/maildir) | 47 | install(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 @@ | |||
1 | include_directories(../) | ||
2 | cmake_policy(SET CMP0063 NEW) | ||
3 | add_executable(settingstest settingstest.cpp) | ||
4 | add_test(settingstest settingstest) | ||
5 | qt5_use_modules(settingstest Core Test Concurrent) | ||
6 | target_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 | |||
7 | class SettingsTest : public QObject | ||
8 | { | ||
9 | Q_OBJECT | ||
10 | private 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 | |||
36 | QTEST_GUILESS_MAIN(SettingsTest) | ||
37 | #include "settingstest.moc" | ||