| 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | // Validate the factory without constructing an effect or touching the desktop. |
| 3 | #include <QCoreApplication> |
| 4 | #include <QJsonObject> |
| 5 | #include <QPluginLoader> |
| 6 | #include <QDebug> |
| 7 | |
| 8 | int main(int argc, char **argv) |
| 9 | { |
| 10 | QCoreApplication app(argc, argv); |
| 11 | if (argc != 2) { |
| 12 | return 2; |
| 13 | } |
| 14 | QPluginLoader loader(QString::fromLocal8Bit(argv[1])); |
| 15 | const auto metadata = loader.metaData().value("MetaData").toObject().value("KPlugin").toObject(); |
| 16 | if (metadata.value("Id").toString() != "clicktween" || !loader.instance()) { |
| 17 | qCritical() << "Plugin check failed:" << loader.errorString(); |
| 18 | return 1; |
| 19 | } |
| 20 | qInfo() << "Plugin metadata and factory loading: OK"; |
| 21 | return 0; |
| 22 | } |