blob: 2067b8c920b8c490df8bcb0141f91dcaa2ff99d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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"
|