diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2022-04-13 14:15:27 +0200 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2022-04-19 17:39:07 +0200 |
commit | d141804e6fb9dd3ea22de2fedf7a75174da25f03 (patch) | |
tree | c68cfdcd83434233fc45e34d670c84f6647c354a /tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp | |
parent | eade31f4891b2c94917c6467221140cb5c8efebd (diff) |
Android: enable tst_qqmlextensionplugin
The test was extracting plugins from the installation directory.
However on Android plugins can be read only from APK's libs subdir.
By default no plugins are copied into the APK, because they are not used.
So add a dummy.qml file which uses some basic stuff from Qt.Quick and
Qt.Quick.Controls. This will force the plugins to be copied into the APK.
Fixes: QTBUG-100169
Pick-to: 6.3 6.2
Change-Id: I31d7a407c655e19f147d461a083f27d6f6cbda72
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp')
-rw-r--r-- | tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp index e3c8151884..d122b1f0c6 100644 --- a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp +++ b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp @@ -76,7 +76,17 @@ private Q_SLOTS: void tst_qqmlextensionplugin::iidCheck_data() { QList<QString> files; + // On Android the plugins are located in the APK's libs subdir. They can + // be distinguished by the name, which starts from "libqml_" and ends with + // "plugin_${ARCH}.so" +#ifdef Q_OS_ANDROID + const QStringList libraryPaths = QCoreApplication::libraryPaths(); + QVERIFY(!libraryPaths.isEmpty()); + const QLatin1String nameFilters("libqml_*plugin_" ANDROID_ARCH "*"); + for (QDirIterator it(libraryPaths.front(), { nameFilters }, QDir::Files); it.hasNext(); ) { +#else for (QDirIterator it(QLibraryInfo::path(QLibraryInfo::QmlImportsPath), QDirIterator::Subdirectories); it.hasNext(); ) { +#endif QString file = it.next(); #if defined(Q_OS_DARWIN) if (file.contains(QLatin1String(".dSYM/"))) |