aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael Cotty <raphael.cotty@gmail.com>2021-04-02 07:52:38 +0200
committerRaphaƫl Cotty <raphael.cotty@gmail.com>2021-04-06 22:12:20 +0000
commit8de1becd8e240512ada3e529c6c7bb16599dca2c (patch)
treeec6d4ed0d31b916b34b06f010397c5b1fcfb8923
parent6bba56d4104cad4ffd9175193a6dfc05a0de55d2 (diff)
Android: Correct qt6 test
Change-Id: I1f05ae51f30f0158cb3dec6ce189d96f52987c7a Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r--.github/workflows/main.yml6
-rw-r--r--docker-compose.yml2
-rw-r--r--docker/focal/test-android.Dockerfile10
-rw-r--r--share/qbs/module-providers/Qt/setup-qt.js6
-rw-r--r--tests/auto/blackbox/testdata-android/qt-app/TestQt6.java54
-rw-r--r--tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs11
-rw-r--r--tests/auto/blackbox/tst_blackboxandroid.cpp4
7 files changed, 87 insertions, 6 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 29f737a1e..951ddc1c3 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -264,6 +264,12 @@ jobs:
script: './scripts/test-qt-for-android.sh',
}
- {
+ name: 'Run Android tests (Qt 6.0.0)',
+ image: 'focal-android-600',
+ profile: '',
+ script: './scripts/test-qt-for-android.sh',
+ }
+ - {
name: 'Run Linux tests (Qt 4.8.7)',
image: 'focal-qt4',
profile: '',
diff --git a/docker-compose.yml b/docker-compose.yml
index 2df603fc5..e00b641c1 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -73,7 +73,7 @@ services:
focal-android-600:
<< : *linux
hostname: focal-android
- image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-6.0.0-1
+ image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-6.0.0-2
build:
dockerfile: docker/focal/test-android.Dockerfile
context: .
diff --git a/docker/focal/test-android.Dockerfile b/docker/focal/test-android.Dockerfile
index 72c84ca0c..11c4a5757 100644
--- a/docker/focal/test-android.Dockerfile
+++ b/docker/focal/test-android.Dockerfile
@@ -72,8 +72,14 @@ ARG ANDROID_PLATFORM="android-29"
ARG BUILD_TOOLS="29.0.2"
RUN yes | sdkmanager "--sdk_root=${ANDROID_HOME}" --verbose --licenses && \
sdkmanager "--sdk_root=${ANDROID_HOME}" --update && \
- sdkmanager "--sdk_root=${ANDROID_HOME}" "platforms;${ANDROID_PLATFORM}" "build-tools;${BUILD_TOOLS}" "platform-tools" "tools" "ndk-bundle" && \
- /usr/lib/jvm/java-8-openjdk-amd64/bin/keytool -genkey -keystore /home/${USER_NAME}/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname 'CN=Android Debug,O=Android,C=US'
+ sdkmanager "--sdk_root=${ANDROID_HOME}" "platforms;${ANDROID_PLATFORM}"
+
+RUN yes | sdkmanager "--sdk_root=${ANDROID_HOME}" "build-tools;${BUILD_TOOLS}"
+RUN yes | sdkmanager "--sdk_root=${ANDROID_HOME}" "platform-tools"
+RUN yes | sdkmanager "--sdk_root=${ANDROID_HOME}" "tools"
+RUN yes | sdkmanager "--sdk_root=${ANDROID_HOME}" "ndk-bundle"
+
+RUN /usr/lib/jvm/java-8-openjdk-amd64/bin/keytool -genkey -keystore /home/${USER_NAME}/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname 'CN=Android Debug,O=Android,C=US'
# Install ndk samples in ${ANDROID_NDK_ROOT}/samples
RUN cd ${ANDROID_NDK_ROOT} && \
diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js
index 5cf1bcb44..c23d51d1b 100644
--- a/share/qbs/module-providers/Qt/setup-qt.js
+++ b/share/qbs/module-providers/Qt/setup-qt.js
@@ -268,8 +268,10 @@ function getQtProperties(qmakeFilePath, qbs) {
(pathQueryValue(queryResult, "QT_INSTALL_DATA"), "mkspecs");
}
- if (Utilities.versionCompare(qtProps.qtVersion, "6") >= 0)
- qtProps.libExecPath = pathQueryValue(queryResult, "QT_INSTALL_LIBEXECS");
+ if (Utilities.versionCompare(qtProps.qtVersion, "6") >= 0) {
+ qtProps.libExecPath = pathQueryValue(queryResult, "QT_HOST_LIBEXECS")
+ || pathQueryValue(queryResult, "QT_INSTALL_LIBEXECS");
+ }
if (!File.exists(qtProps.mkspecBasePath))
throw "Cannot extract the mkspecs directory.";
diff --git a/tests/auto/blackbox/testdata-android/qt-app/TestQt6.java b/tests/auto/blackbox/testdata-android/qt-app/TestQt6.java
new file mode 100644
index 000000000..239507122
--- /dev/null
+++ b/tests/auto/blackbox/testdata-android/qt-app/TestQt6.java
@@ -0,0 +1,54 @@
+package org.qbs.example;
+
+import org.qtproject.qt.android.bindings.QtActivity;
+import android.os.*;
+import android.content.*;
+import android.app.*;
+import android.util.Log;
+
+import java.lang.String;
+import android.content.Intent;
+
+import org.qbs.example.*;
+
+
+public class TestQt6 extends QtActivity
+{
+ public static native void testFunc(String test);
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ Log.d("qbs", "onCreate Test");
+ Intent theIntent = getIntent();
+ if (theIntent != null) {
+ String theAction = theIntent.getAction();
+ if (theAction != null) {
+ Log.d("qbs onCreate ", theAction);
+ }
+ }
+ }
+
+ @Override
+ public void onDestroy() {
+ Log.d("qbs", "onDestroy");
+ System.exit(0);
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ Log.d("qbs onActivityResult", "requestCode: "+requestCode);
+ if (resultCode == RESULT_OK) {
+ Log.d("qbs onActivityResult - resultCode: ", "SUCCESS");
+ } else {
+ Log.d("qbs onActivityResult - resultCode: ", "CANCEL");
+ }
+ }
+
+ @Override
+ public void onNewIntent(Intent intent) {
+ Log.d("qbs", "onNewIntent");
+ super.onNewIntent(intent);
+ setIntent(intent);
+ }
+}
diff --git a/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs b/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs
index 94093af64..04dcbf403 100644
--- a/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs
+++ b/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs
@@ -1,7 +1,16 @@
Project {
QtGuiApplication {
Depends { name: "Lib" }
- files: ["main.cpp", "MainWindow.cpp", "MainWindow.h", "Test.java"]
+ files: ["main.cpp", "MainWindow.cpp", "MainWindow.h" ]
+ Group {
+ condition: Qt.core.versionMajor == 5
+ files: ["Test.java"]
+ }
+ Group {
+ condition: Qt.core.versionMajor == 6
+ files: ["TestQt6.java"]
+ }
+
Android.sdk.packageName: "my.qtapp"
Android.sdk.apkBaseName: name
Depends { name: "Qt"; submodules: ["core", "widgets"] }
diff --git a/tests/auto/blackbox/tst_blackboxandroid.cpp b/tests/auto/blackbox/tst_blackboxandroid.cpp
index f8ed8a0b9..df48c35e9 100644
--- a/tests/auto/blackbox/tst_blackboxandroid.cpp
+++ b/tests/auto/blackbox/tst_blackboxandroid.cpp
@@ -619,6 +619,8 @@ void TestBlackboxAndroid::android_data()
"lib/${ARCH}/libqml_QtQml_Models_modelsplugin_${ARCH}.so",
"lib/${ARCH}/libqml_QtQml_WorkerScript_workerscriptplugin_${ARCH}.so",
"lib/${ARCH}/libqml_QtQml_qmlplugin_${ARCH}.so",
+ "lib/${ARCH}/libqml_QtQuick_Window_quickwindow_${ARCH}.so",
+ "lib/${ARCH}/libqml_QtQuick_tooling_quicktooling_${ARCH}.so",
"lib/${ARCH}/libqml_QtQuick_Controls_Basic_impl_qtquickcontrols2basicstyleimplplugin_${ARCH}.so",
"lib/${ARCH}/libqml_QtQuick_Controls_Basic_qtquickcontrols2basicstyleplugin_${ARCH}.so",
"lib/${ARCH}/libqml_QtQuick_Controls_Fusion_impl_qtquickcontrols2fusionstyleimplplugin_${ARCH}.so",
@@ -774,6 +776,8 @@ void TestBlackboxAndroid::android_data()
"lib/${ARCH}/libqml_QtQml_Models_modelsplugin_${ARCH}.so",
"lib/${ARCH}/libqml_QtQml_WorkerScript_workerscriptplugin_${ARCH}.so",
"lib/${ARCH}/libqml_QtQml_qmlplugin_${ARCH}.so",
+ "lib/${ARCH}/libqml_QtQuick_Window_quickwindow_${ARCH}.so",
+ "lib/${ARCH}/libqml_QtQuick_tooling_quicktooling_${ARCH}.so",
"lib/${ARCH}/libqml_QtQuick_Controls_Basic_impl_qtquickcontrols2basicstyleimplplugin_${ARCH}.so",
"lib/${ARCH}/libqml_QtQuick_Controls_Basic_qtquickcontrols2basicstyleplugin_${ARCH}.so",
"lib/${ARCH}/libqml_QtQuick_Controls_Fusion_impl_qtquickcontrols2fusionstyleimplplugin_${ARCH}.so",