diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-08-28 12:57:13 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-08-29 07:46:51 +0000 |
commit | 16fd248b6169c89bfb9e7525b5c8bd061418f0b6 (patch) | |
tree | da827fba2bcfc845351290661aca9b748b685513 /tests/auto/blackbox/testdata-android | |
parent | 811edc5952caf265a4c56b52933165830838dab1 (diff) |
Separate the Java and Android autotests into their own suites
Android is not inherently tied to Java. Android apps can be built
without any Java at all (for example, using Kotlin and/or C++ instead of
Java).
This also paves the way to greatly expand the Android test suite as we
should be independently testing various pieces of functionality rather
than grouping everything into a single multi-axis test case.
Change-Id: I0b2950e701461320e7eb7266acccc78f5d98261f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata-android')
26 files changed, 541 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/multiple-apks-per-project.qbs b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/multiple-apks-per-project.qbs new file mode 100644 index 000000000..3d03c309a --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/multiple-apks-per-project.qbs @@ -0,0 +1,8 @@ +import qbs + +Project { + references: [ + "product1", + "product2", + ] +} diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/product1.qbs b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/product1.qbs new file mode 100644 index 000000000..0ddd7526c --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/product1.qbs @@ -0,0 +1,31 @@ +import qbs + +Project { + DynamicLibrary { + Depends { name: "Android.ndk" } + Depends { name: "cpp" } + name: "p1lib1" + files: ["src/main/jni/lib1.cpp"] + Android.ndk.appStl: "stlport_shared" + qbs.architectures: !qbs.architecture ? ["mips", "x86"] : undefined + cpp.useRPaths: false + } + + DynamicLibrary { + Depends { name: "Android.ndk" } + Depends { name: "cpp" } + name: "p1lib2" + files: ["src/main/jni/lib2.cpp"] + Android.ndk.appStl: "stlport_shared" + cpp.useRPaths: false + } + + AndroidApk { + name: "twolibs1" + packageName: "io.qt.dummy1" + Depends { + productTypes: ["android.nativelibrary"] + limitToSubProject: true + } + } +} diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/AndroidManifest.xml b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/AndroidManifest.xml new file mode 100644 index 000000000..1468b52f6 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/AndroidManifest.xml @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.qt.dummy1" android:versionCode="1" android:versionName="1.0"> + <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="19"/> + <uses-feature android:glEsVersion="0x00020000"/> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> + <application android:allowBackup="true" android:hasCode="true" android:name="io.qt.dummy"> + <activity android:name="dummy" android:debuggable="true" android:configChanges="orientation|keyboardHidden"> + <!-- Tell NativeActivity the name of or .so --> + <meta-data android:name="android.app.lib_name" android:value="dummy1"/> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + </activity> + </application> +</manifest> diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/java/io/qt/dummy/Dummy.java b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/java/io/qt/dummy/Dummy.java new file mode 100644 index 000000000..149af081f --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/java/io/qt/dummy/Dummy.java @@ -0,0 +1,11 @@ +package io.qt.dummy; + +import android.app.Activity; + +public class Dummy extends Activity +{ + static { + System.loadLibrary("lib1"); + System.loadLibrary("lib"); + } +} diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/jni/lib1.cpp b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/jni/lib1.cpp new file mode 100644 index 000000000..474897da9 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/jni/lib1.cpp @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +void f() {} diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/jni/lib2.cpp b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/jni/lib2.cpp new file mode 100644 index 000000000..de580ab09 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/jni/lib2.cpp @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +void g() {} diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/res/values/strings.xml b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/res/values/strings.xml new file mode 100644 index 000000000..949748954 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">dummy1</string> +</resources> diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/product2.qbs b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/product2.qbs new file mode 100644 index 000000000..f0418a425 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/product2.qbs @@ -0,0 +1,27 @@ +import qbs + +Project { + DynamicLibrary { + Depends { name: "cpp" } + name: "p2lib1" + files: ["src/main/jni/lib1.cpp"] + cpp.useRPaths: false + } + + DynamicLibrary { + Depends { name: "Android.ndk" } + Depends { name: "cpp" } + name: "p2lib2" + files: ["src/main/jni/lib2.cpp"] + Android.ndk.appStl: "stlport_shared" + } + + AndroidApk { + name: "twolibs2" + packageName: "io.qt.dummy2" + Depends { + productTypes: ["android.nativelibrary"] + limitToSubProject: true + } + } +} diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/AndroidManifest.xml b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/AndroidManifest.xml new file mode 100644 index 000000000..4e5cdf977 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/AndroidManifest.xml @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.qt.dummy2" android:versionCode="1" android:versionName="1.0"> + <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="19"/> + <uses-feature android:glEsVersion="0x00020000"/> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> + <application android:allowBackup="true" android:hasCode="true" android:name="io.qt.dummy"> + <activity android:name="dummy" android:debuggable="true" android:configChanges="orientation|keyboardHidden"> + <!-- Tell NativeActivity the name of or .so --> + <meta-data android:name="android.app.lib_name" android:value="dummy2"/> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + </activity> + </application> +</manifest> diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/java/io/qt/dummy/Dummy.java b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/java/io/qt/dummy/Dummy.java new file mode 100644 index 000000000..149af081f --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/java/io/qt/dummy/Dummy.java @@ -0,0 +1,11 @@ +package io.qt.dummy; + +import android.app.Activity; + +public class Dummy extends Activity +{ + static { + System.loadLibrary("lib1"); + System.loadLibrary("lib"); + } +} diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/jni/lib1.cpp b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/jni/lib1.cpp new file mode 100644 index 000000000..474897da9 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/jni/lib1.cpp @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +void f() {} diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/jni/lib2.cpp b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/jni/lib2.cpp new file mode 100644 index 000000000..de580ab09 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/src/main/jni/lib2.cpp @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +void g() {} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/io/qbs/lib3/lib3.java b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/io/qbs/lib3/lib3.java new file mode 100644 index 000000000..09ce152c3 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/io/qbs/lib3/lib3.java @@ -0,0 +1,6 @@ +package io.qbs.lib3; + +public class lib3 { + public static void foo() { + } +} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib4.java b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib4.java new file mode 100644 index 000000000..7b1de6c8b --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib4.java @@ -0,0 +1,2 @@ +public class lib4 { +} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib5.java b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib5.java new file mode 100644 index 000000000..92ab6dee2 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib5.java @@ -0,0 +1,2 @@ +public class lib5 { +} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib6.java b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib6.java new file mode 100644 index 000000000..c524967ee --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib6.java @@ -0,0 +1,2 @@ +public class lib6 { +} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib7.java b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib7.java new file mode 100644 index 000000000..110bab22c --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib7.java @@ -0,0 +1,2 @@ +public class lib7 { +} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib8.java b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib8.java new file mode 100644 index 000000000..e0cb448f0 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/lib8.java @@ -0,0 +1,2 @@ +public class lib8 { +} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/multiple-libs-per-apk.qbs b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/multiple-libs-per-apk.qbs new file mode 100644 index 000000000..d76a41232 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/multiple-libs-per-apk.qbs @@ -0,0 +1,69 @@ +import qbs + +Project { + DynamicLibrary { + Depends { name: "Android.ndk" } + Depends { name: "cpp" } + name: "lib1" + files: ["src/main/jni/lib1.cpp"] + Android.ndk.appStl: "stlport_shared" + cpp.useRPaths: false + } + + DynamicLibrary { + Depends { name: "Android.ndk" } + Depends { name: "cpp" } + name: "lib2" + files: ["src/main/jni/lib2.cpp"] + Android.ndk.appStl: "stlport_shared" + cpp.useRPaths: false + } + + JavaJarFile { + Depends { name: "Android.sdk" } + Depends { name: "lib6" } + Depends { name: "lib8" } + name: "lib3" + files: ["io/qbs/lib3/lib3.java"] + } + + JavaJarFile { + Depends { name: "Android.sdk" } + name: "lib4" + files: ["lib4.java"] + } + + JavaJarFile { + Depends { name: "Android.sdk" } + name: "lib5" + files: ["lib5.java"] + } + + JavaJarFile { + Depends { name: "Android.sdk" } + name: "lib6" + files: ["lib6.java"] + } + + JavaJarFile { + Depends { name: "Android.sdk" } + name: "lib7" + files: ["lib7.java"] + } + + JavaJarFile { + Depends { name: "Android.sdk" } + Depends { name: "lib7"; Android.sdk.embedJar: false } + name: "lib8" + files: ["lib8.java"] + } + + AndroidApk { + name: "twolibs" + packageName: "io.qt.dummy" + Depends { productTypes: ["android.nativelibrary"] } + Depends { name: "lib3"; Android.sdk.embedJar: true } + Depends { name: "lib4"; Android.sdk.embedJar: false } + Depends { name: "lib5" } + } +} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/AndroidManifest.xml b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/AndroidManifest.xml new file mode 100644 index 000000000..639d3a647 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/AndroidManifest.xml @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.qt.dummy" android:versionCode="1" android:versionName="1.0"> + <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="19"/> + <uses-feature android:glEsVersion="0x00020000"/> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> + <application android:allowBackup="true" android:hasCode="true" android:name="io.qt.dummy"> + <activity android:name="dummy" android:debuggable="true" android:configChanges="orientation|keyboardHidden"> + <!-- Tell NativeActivity the name of or .so --> + <meta-data android:name="android.app.lib_name" android:value="dummy"/> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + </activity> + </application> +</manifest> diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/java/io/qt/dummy/Dummy.java b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/java/io/qt/dummy/Dummy.java new file mode 100644 index 000000000..e98fb2166 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/java/io/qt/dummy/Dummy.java @@ -0,0 +1,13 @@ +package io.qt.dummy; + +import android.app.Activity; +import io.qbs.lib3.lib3; + +public class Dummy extends Activity +{ + static { + System.loadLibrary("lib1"); + System.loadLibrary("lib"); + lib3.foo(); + } +} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/jni/lib1.cpp b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/jni/lib1.cpp new file mode 100644 index 000000000..474897da9 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/jni/lib1.cpp @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +void f() {} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/jni/lib2.cpp b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/jni/lib2.cpp new file mode 100644 index 000000000..de580ab09 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/jni/lib2.cpp @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +void g() {} diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/res/values/strings.xml b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/res/values/strings.xml new file mode 100644 index 000000000..297dfa7fa --- /dev/null +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">dummy</string> +</resources> diff --git a/tests/auto/blackbox/testdata-android/no-native/no-native.qbs b/tests/auto/blackbox/testdata-android/no-native/no-native.qbs new file mode 100644 index 000000000..2909adc0c --- /dev/null +++ b/tests/auto/blackbox/testdata-android/no-native/no-native.qbs @@ -0,0 +1,8 @@ +import qbs + +AndroidApk { + name: "com.example.android.basicmediadecoder" + + sourceSetDir: Android.sdk.sdkDir + + "/samples/android-BasicMediaDecoder/Application/src/main" +} diff --git a/tests/auto/blackbox/testdata-android/teapot/teapot.qbs b/tests/auto/blackbox/testdata-android/teapot/teapot.qbs new file mode 100644 index 000000000..47952d3d3 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/teapot/teapot.qbs @@ -0,0 +1,119 @@ +import qbs +import qbs.File + +Project { + minimumQbsVersion: qbs.version + StaticLibrary { + name: "native-glue" + Depends { name: "cpp" } + Group { + id: glue_sources + prefix: Android.ndk.ndkDir + "/sources/android/native_app_glue/" + files: ["*.c", "*.h"] + } + + Export { + Depends { name: "cpp" } + cpp.includePaths: [glue_sources.prefix] + cpp.dynamicLibraries: ["log"] + } + } + + StaticLibrary { + name: "ndk-helper" + Depends { name: "Android.ndk" } + Depends { name: "cpp" } + Depends { name: "native-glue" } + + Group { + id: ndkhelper_sources + prefix: Android.ndk.ndkDir + "/sources/android/ndk_helper/" + files: ["*.c", "*.cpp", "*.h"] + } + Android.ndk.appStl: "stlport_shared" + + Export { + Depends { name: "cpp" } + cpp.includePaths: [ndkhelper_sources.prefix] + cpp.dynamicLibraries: ["log", "android", "EGL", "GLESv2"] + } + } + + StaticLibrary { + name: "android_cpufeatures" + Depends { name: "cpp" } + Group { + id: cpufeatures_sources + prefix: Android.ndk.ndkDir + "/sources/android/cpufeatures/" + files: ["*.c", "*.h"] + } + + Export { + Depends { name: "cpp" } + cpp.includePaths: [cpufeatures_sources.prefix] + cpp.dynamicLibraries: ["dl"] + } + } + + DynamicLibrary { + name: "TeapotNativeActivity" + Depends { name: "Android.ndk" } + Depends { name: "cpp" } + Depends { name: "android_cpufeatures" } + Depends { name: "native-glue" } + Depends { name: "ndk-helper" } + + Probe { + id: teapotProbeJni + property string samplesDir: Android.ndk.ndkSamplesDir + property string jniDir + configure: { + var paths = ["/teapots/classic-teapot/src/main/cpp/", "/Teapot/app/src/main/jni/"]; + for (var i = 0; i < paths.length; ++i) { + if (File.exists(samplesDir + paths[i])) { + jniDir = samplesDir + paths[i]; + break; + } + } + } + } + + Group { + name: "C++ sources" + prefix: teapotProbeJni.jniDir + files: [ + "TeapotNativeActivity.cpp", + "TeapotRenderer.cpp", + "TeapotRenderer.h", + "teapot.inl", + ] + } + + FileTagger { patterns: ["*.inl"]; fileTags: ["hpp"] } + + Android.ndk.appStl: "stlport_shared" + cpp.dynamicLibraries: ["log", "android", "EGL", "GLESv2"] + cpp.useRPaths: false + } + + AndroidApk { + Probe { + id: teapotProbe + property string samplesDir: Android.sdk.ndkSamplesDir + property string dir + configure: { + var paths = ["/teapots/classic-teapot/src/main", "/Teapot/app/src/main"]; + for (var i = 0; i < paths.length; ++i) { + if (File.exists(samplesDir + paths[i])) { + dir = samplesDir + paths[i]; + break; + } + } + } + } + + name: "com.sample.teapot" + sourceSetDir: teapotProbe.dir + Depends { productTypes: ["android.nativelibrary"] } + } +} |