summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-07-25 17:31:31 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-07-25 17:31:31 +0200
commit5892cf6b29c62cc632e94b22624a0bbbe6c21c54 (patch)
tree5bd071420c3fe3c71102c427c37e952449e90131 /tests
parent58f472fa0a87d21f28d58244686b332f99d5a52c (diff)
downloadkube-5892cf6b29c62cc632e94b22624a0bbbe6c21c54.tar.gz
kube-5892cf6b29c62cc632e94b22624a0bbbe6c21c54.zip
Shutdown resources at the end of the test
to keep them from blocking the test from exiting.
Diffstat (limited to 'tests')
-rw-r--r--tests/teststore.cpp8
-rw-r--r--tests/teststore.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/teststore.cpp b/tests/teststore.cpp
index 71b19499..c69588ef 100644
--- a/tests/teststore.cpp
+++ b/tests/teststore.cpp
@@ -243,6 +243,14 @@ void TestStore::setup(const QVariantMap &map)
243 Sink::ResourceControl::flushMessageQueue(resources).exec().waitForFinished(); 243 Sink::ResourceControl::flushMessageQueue(resources).exec().waitForFinished();
244} 244}
245 245
246void TestStore::shutdownResources()
247{
248 const auto resources = Sink::Store::read<Sink::ApplicationDomain::SinkResource>({});
249 for (const auto &resource : resources) {
250 Sink::ResourceControl::shutdown(resource.identifier()).exec().waitForFinished();
251 }
252}
253
246QVariant TestStore::load(const QByteArray &type, const QVariantMap &filter) 254QVariant TestStore::load(const QByteArray &type, const QVariantMap &filter)
247{ 255{
248 using namespace Sink::ApplicationDomain; 256 using namespace Sink::ApplicationDomain;
diff --git a/tests/teststore.h b/tests/teststore.h
index 1a6a2563..4d5359a7 100644
--- a/tests/teststore.h
+++ b/tests/teststore.h
@@ -27,6 +27,7 @@ class TestStore : public QObject {
27 Q_OBJECT 27 Q_OBJECT
28public: 28public:
29 Q_INVOKABLE void setup(const QVariantMap &); 29 Q_INVOKABLE void setup(const QVariantMap &);
30 Q_INVOKABLE void shutdownResources();
30 Q_INVOKABLE QVariant load(const QByteArray &type, const QVariantMap &); 31 Q_INVOKABLE QVariant load(const QByteArray &type, const QVariantMap &);
31 Q_INVOKABLE QVariantList loadList(const QByteArray &type, const QVariantMap &); 32 Q_INVOKABLE QVariantList loadList(const QByteArray &type, const QVariantMap &);
32 Q_INVOKABLE QVariantMap read(const QVariant &); 33 Q_INVOKABLE QVariantMap read(const QVariant &);