summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp')
-rw-r--r--tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp b/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp
new file mode 100644
index 0000000000..2067b8c920
--- /dev/null
+++ b/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp
@@ -0,0 +1,33 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QtTest/QtTest>
+#include <QtCore/qfile.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qpluginloader.h>
+#include <QtPlugin>
+
+Q_IMPORT_PLUGIN(TestStaticPlugin)
+
+class TestInitResourcesStaticPlugin : public QObject
+{
+ Q_OBJECT
+private slots:
+ void resourceFilesExist();
+};
+
+void TestInitResourcesStaticPlugin::resourceFilesExist()
+{
+ bool result = false;
+ for (QObject *obj : QPluginLoader::staticInstances()) {
+ if (obj->metaObject()->className() == QLatin1String("TestStaticPlugin")) {
+ QMetaObject::invokeMethod(obj, "checkResources", Qt::DirectConnection,
+ Q_RETURN_ARG(bool, result));
+ }
+ break;
+ }
+ QVERIFY(result);
+}
+
+QTEST_MAIN(TestInitResourcesStaticPlugin)
+#include "test_init_resources_static_plugin.moc"