[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [ksecrets] autotests: Also renaming the tests related to the store
From: Valentin Rusu <kde () rusu ! info>
Date: 2015-08-12 11:26:26
Message-ID: E1ZPUAs-0007H7-T7 () scm ! kde ! org
[Download RAW message or body]
Git commit c431b535d60f760bd42ccb61dd25b329163837f6 by Valentin Rusu.
Committed on 11/08/2015 at 14:29.
Pushed by vrusu into branch 'master'.
Also renaming the tests related to the store
M +1 -1 autotests/CMakeLists.txt
A +18 -0 autotests/ksecrets_store/CMakeLists.txt
A +52 -0 autotests/ksecrets_store/ksecrets_store_test.cpp \
[License: LGPL (v2+)] A +36 -0 \
autotests/ksecrets_store/ksecrets_store_test.h [License: LGPL (v2+)]
http://commits.kde.org/ksecrets/c431b535d60f760bd42ccb61dd25b329163837f6
diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index e359f58..bfc99cf 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -1,2 +1,2 @@
add_subdirectory(api)
-add_subdirectory(ksecrets_backend)
+add_subdirectory(ksecrets_store)
diff --git a/autotests/ksecrets_store/CMakeLists.txt \
b/autotests/ksecrets_store/CMakeLists.txt new file mode 100644
index 0000000..facb282
--- /dev/null
+++ b/autotests/ksecrets_store/CMakeLists.txt
@@ -0,0 +1,18 @@
+
+include(ECMMarkAsTest)
+include(ECMAddTests)
+
+find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test)
+
+include_directories(${CMAKE_SOURCE_DIR}/src/runtime/ksecrets_store)
+
+if(NOT Qt5Test_FOUND)
+ message(STATUS "Qt5Test not found, autotests will not be built.")
+ return()
+endif()
+
+ecm_add_test(
+ ksecrets_store_test.cpp
+ LINK_LIBRARIES Qt5::Test ksecrets_store
+)
+
diff --git a/autotests/ksecrets_store/ksecrets_store_test.cpp \
b/autotests/ksecrets_store/ksecrets_store_test.cpp new file mode 100644
index 0000000..ba70646
--- /dev/null
+++ b/autotests/ksecrets_store/ksecrets_store_test.cpp
@@ -0,0 +1,52 @@
+/*
+ This file is part of the KDE Libraries
+
+ Copyright (C) 2015 Valentin Rusu (valir@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public \
License + along with this library; see the file COPYING.LIB. If not, \
write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth \
Floor, + Boston, MA 02110-1301, USA.
+*/
+
+#include "ksecrets_backend_test.h"
+
+#include <ksecrets_backend.h>
+#include <QtTest/QtTest>
+#include <QtCore/QDir>
+
+QTEST_GUILESS_MAIN(KSecretServiceStoreTest);
+
+const char* test_file_path = "~/.qttest/ksecretsbackend-test.dat";
+
+KSecretServiceStoreTest::KSecretServiceStoreTest(QObject* parent)
+ : QObject(parent)
+{
+}
+
+void KSecretServiceStoreTest::initTestCase()
+{
+}
+
+void KSecretServiceStoreTest::cleanupTestCase()
+{
+ QDir::home().remove(QLatin1Literal(test_file_path));
+}
+
+void KSecretServiceStoreTest::testOpen()
+{
+ KSecretsStore backend;
+ auto openfut = backend.open(test_file_path, true);
+ auto openres = openfut.get();
+ QVERIFY(openres.status_ == KSecretsStore::OpenStatus::Good);
+}
diff --git a/autotests/ksecrets_store/ksecrets_store_test.h \
b/autotests/ksecrets_store/ksecrets_store_test.h new file mode 100644
index 0000000..a2e31a5
--- /dev/null
+++ b/autotests/ksecrets_store/ksecrets_store_test.h
@@ -0,0 +1,36 @@
+/*
+ This file is part of the KDE Libraries
+
+ Copyright (C) 2015 Valentin Rusu (valir@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public \
License + along with this library; see the file COPYING.LIB. If not, \
write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth \
Floor, + Boston, MA 02110-1301, USA.
+*/
+#ifndef KSECRETSBACKENDTEST_H
+#define KSECRETSBACKENDTEST_H
+
+#include <QtCore/QObject>
+
+class KSecretServiceStoreTest : public QObject {
+ Q_OBJECT
+public:
+ explicit KSecretServiceStoreTest(QObject* parent = 0);
+private Q_SLOTS:
+ void initTestCase();
+ void testOpen();
+ void cleanupTestCase();
+};
+
+#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic