From 5892cf6b29c62cc632e94b22624a0bbbe6c21c54 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 25 Jul 2018 17:31:31 +0200 Subject: Shutdown resources at the end of the test to keep them from blocking the test from exiting. --- tests/teststore.cpp | 8 ++++++++ tests/teststore.h | 1 + 2 files changed, 9 insertions(+) (limited to 'tests') 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) Sink::ResourceControl::flushMessageQueue(resources).exec().waitForFinished(); } +void TestStore::shutdownResources() +{ + const auto resources = Sink::Store::read({}); + for (const auto &resource : resources) { + Sink::ResourceControl::shutdown(resource.identifier()).exec().waitForFinished(); + } +} + QVariant TestStore::load(const QByteArray &type, const QVariantMap &filter) { 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 { Q_OBJECT public: Q_INVOKABLE void setup(const QVariantMap &); + Q_INVOKABLE void shutdownResources(); Q_INVOKABLE QVariant load(const QByteArray &type, const QVariantMap &); Q_INVOKABLE QVariantList loadList(const QByteArray &type, const QVariantMap &); Q_INVOKABLE QVariantMap read(const QVariant &); -- cgit v1.2.3