summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
authorRaphaël Cotty <raphael.cotty@gmail.com>2020-09-06 15:18:51 +0200
committerRaphaël Cotty <raphael.cotty@gmail.com>2020-10-21 07:38:14 +0000
commiteb7adb8d9787dddef89e46f7bf6e594d0b5faf4b (patch)
treeba721a09ccd9a536228fb80cb602f9d566bb77e8 /tests/auto
parentccb384ae52107b0322d7eae1fb75ff8df1e28f26 (diff)
downloadqbs-eb7adb8d9787dddef89e46f7bf6e594d0b5faf4b.tar.gz
Android: Allow exporting of Qt modules by using importingProduct
The product variable in the Export item refers to the exporting item. If a qbs property is changed (example: qbs.architecture for the multiplexing in Android) then the Depend failed because the qbs module was not loaded yet for the exporting item. Fixes: QBS-1576 Change-Id: I220c47b3094727fe169d3dccd244ab2785a782b7 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/blackbox/testdata-android/qt-app/main.cpp10
-rw-r--r--tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs18
-rw-r--r--tests/auto/blackbox/tst_blackboxandroid.cpp53
3 files changed, 80 insertions, 1 deletions
diff --git a/tests/auto/blackbox/testdata-android/qt-app/main.cpp b/tests/auto/blackbox/testdata-android/qt-app/main.cpp
new file mode 100644
index 000000000..6278e2924
--- /dev/null
+++ b/tests/auto/blackbox/testdata-android/qt-app/main.cpp
@@ -0,0 +1,10 @@
+#include <QMainWindow>
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ QMainWindow w;
+ w.show();
+ return 0;
+}
diff --git a/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs b/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs
new file mode 100644
index 000000000..ceeda2dc3
--- /dev/null
+++ b/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs
@@ -0,0 +1,18 @@
+Project {
+ QtGuiApplication {
+ Depends { name: "Lib" }
+ files: "main.cpp"
+ Android.sdk.packageName: "my.qtapp"
+ Android.sdk.apkBaseName: name
+ Depends { name: "Qt"; submodules: ["core", "widgets"] }
+ }
+
+ StaticLibrary {
+ name: "Lib"
+ Export {
+ Depends {
+ name: "Qt.android_support";
+ }
+ }
+ }
+}
diff --git a/tests/auto/blackbox/tst_blackboxandroid.cpp b/tests/auto/blackbox/tst_blackboxandroid.cpp
index 5e850874e..95e9997bc 100644
--- a/tests/auto/blackbox/tst_blackboxandroid.cpp
+++ b/tests/auto/blackbox/tst_blackboxandroid.cpp
@@ -85,7 +85,7 @@ void TestBlackboxAndroid::android()
QFETCH(bool, isIncrementalBuild);
const SettingsPtr s = settings();
- Profile p(theProfileName(projectDir == "qml-app"), s.get());
+ Profile p(theProfileName(projectDir == "qml-app" || projectDir == "qt-app"), s.get());
if (!p.exists())
p = Profile("none", s.get());
int status;
@@ -292,6 +292,57 @@ void TestBlackboxAndroid::android_data()
bool generateAab = false;
bool isIncrementalBuild = false;
+ auto qtAppExpectedFiles = [&](bool generateAab) {
+ QByteArrayList expectedFile;
+ if (usingOldQt) {
+ expectedFile << commonFiles(generateAab) + expandArchs(ndkArchsForQt, {
+ cxxLibPath("libgnustl_shared.so", true),
+ "assets/--Added-by-androiddeployqt--/qt_cache_pregenerated_file_list",
+ "lib/${ARCH}/libplugins_imageformats_libqgif.so",
+ "lib/${ARCH}/libplugins_imageformats_libqicns.so",
+ "lib/${ARCH}/libplugins_imageformats_libqico.so",
+ "lib/${ARCH}/libplugins_imageformats_libqjpeg.so",
+ "lib/${ARCH}/libplugins_imageformats_libqtga.so",
+ "lib/${ARCH}/libplugins_imageformats_libqtiff.so",
+ "lib/${ARCH}/libplugins_imageformats_libqwbmp.so",
+ "lib/${ARCH}/libplugins_imageformats_libqwebp.so",
+ "lib/${ARCH}/libplugins_platforms_android_libqtforandroid.so",
+ "lib/${ARCH}/libplugins_styles_libqandroidstyle.so",
+ "lib/${ARCH}/libQt5Core.so",
+ "lib/${ARCH}/libQt5Gui.so",
+ "lib/${ARCH}/libQt5Widgets.so",
+ "lib/${ARCH}/libqt-app.so"}, generateAab);
+ } else {
+ expectedFile << commonFiles(generateAab) + expandArchs(ndkArchsForQt, {
+ cxxLibPath("libgnustl_shared.so", true),
+ "lib/${ARCH}/libplugins_imageformats_qgif_${ARCH}.so",
+ "lib/${ARCH}/libplugins_imageformats_qicns_${ARCH}.so",
+ "lib/${ARCH}/libplugins_imageformats_qico_${ARCH}.so",
+ "lib/${ARCH}/libplugins_imageformats_qjpeg_${ARCH}.so",
+ "lib/${ARCH}/libplugins_imageformats_qtga_${ARCH}.so",
+ "lib/${ARCH}/libplugins_imageformats_qtiff_${ARCH}.so",
+ "lib/${ARCH}/libplugins_imageformats_qwbmp_${ARCH}.so",
+ "lib/${ARCH}/libplugins_imageformats_qwebp_${ARCH}.so",
+ "lib/${ARCH}/libplugins_platforms_qtforandroid_${ARCH}.so",
+ "lib/${ARCH}/libplugins_styles_qandroidstyle_${ARCH}.so",
+ "lib/${ARCH}/libQt5Core_${ARCH}.so",
+ "lib/${ARCH}/libQt5Gui_${ARCH}.so",
+ "lib/${ARCH}/libQt5Widgets_${ARCH}.so",
+ "lib/${ARCH}/libqt-app_${ARCH}.so"}, generateAab);
+ }
+ if (generateAab)
+ expectedFile << "base/resources.pb" << "base/assets.pb" << "base/native.pb";
+ else
+ expectedFile << "resources.arsc";
+ return expectedFile;
+ };
+ QTest::newRow("qt app")
+ << "qt-app" << QStringList("qt-app")
+ << (QList<QByteArrayList>() << (QByteArrayList() << qtAppExpectedFiles(generateAab)
+ << "res/layout/splash.xml"))
+ << QStringList{aaptVersion(enableAapt2), packageType(generateAab)}
+ << enableAapt2 << generateAab << isIncrementalBuild;
+
auto teaPotAppExpectedFiles = [&](const QByteArrayList &archs, bool generateAab) {
QByteArrayList expectedFile;
expectedFile << commonFiles(generateAab) + expandArchs(archs, {