1#!/usr/bin/env bash
2set -eu
3
4#############################################################################
5##
6## Copyright (C) 2019 Richard Weickelt.
7## Contact: https://www.qt.io/licensing/
8##
9## This file is part of Qbs.
10##
11## $QT_BEGIN_LICENSE:LGPL$
12## Commercial License Usage
13## Licensees holding valid commercial Qt licenses may use this file in
14## accordance with the commercial license agreement provided with the
15## Software or, alternatively, in accordance with the terms contained in
16## a written agreement between you and The Qt Company. For licensing terms
17## and conditions see https://www.qt.io/terms-conditions. For further
18## information use the contact form at https://www.qt.io/contact-us.
19##
20## GNU Lesser General Public License Usage
21## Alternatively, this file may be used under the terms of the GNU Lesser
22## General Public License version 3 as published by the Free Software
23## Foundation and appearing in the file LICENSE.LGPL3 included in the
24## packaging of this file. Please review the following information to
25## ensure the GNU Lesser General Public License version 3 requirements
26## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
27##
28## GNU General Public License Usage
29## Alternatively, this file may be used under the terms of the GNU
30## General Public License version 2.0 or (at your option) the GNU General
31## Public license version 3 or any later version approved by the KDE Free
32## Qt Foundation. The licenses are as published by the Free Software
33## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
34## included in the packaging of this file. Please review the following
35## information to ensure the GNU General Public License requirements will
36## be met: https://www.gnu.org/licenses/gpl-2.0.html and
37## https://www.gnu.org/licenses/gpl-3.0.html.
38##
39## $QT_END_LICENSE$
40##
41#############################################################################
42
43export PATH="$1:$PATH"
44
45export LSAN_OPTIONS="suppressions=$( cd "$(dirname "$0")" ; pwd -P )/address-sanitizer-suppressions.txt:print_suppressions=0"
46
47#
48# These are set outside of this script, for instance in the Docker image
49#
50QT_INSTALL_DIR=/opt/Qt/${QT_VERSION}
51echo "Android SDK installed at ${ANDROID_SDK_ROOT}"
52echo "Android NDK installed at ${ANDROID_NDK_ROOT}"
53echo "Qt installed at ${QT_INSTALL_DIR}"
54
55# Cleaning profiles
56qbs config --unset profiles.qbs_autotests-android
57qbs config --unset profiles.qbs_autotests-android-qt
58
59# Setting auto test profiles
60qbs setup-android --ndk-dir ${ANDROID_NDK_ROOT} --sdk-dir ${ANDROID_SDK_ROOT} qbs_autotests-android
61qbs setup-android --ndk-dir ${ANDROID_NDK_ROOT} --sdk-dir ${ANDROID_SDK_ROOT} --qt-dir ${QT_INSTALL_DIR} qbs_autotests-android-qt
62
63export QBS_AUTOTEST_PROFILE=qbs_autotests-android
64export QBS_AUTOTEST_ALWAYS_LOG_STDERR=true
65export QTEST_FUNCTION_TIMEOUT=9000000
66
67if [ ! "${QT_VERSION}" \< "5.14.0" ] && [ "${QT_VERSION}" \< "6.0.0" ]; then
68    echo "Using multi-arch data sets for qml tests (only for qt version >= 5.14 and < 6.0.0) with all architectures"
69    qbs config --list
70    tst_blackbox-android
71fi;
72
73echo "Using single-arch (armv7a) data sets for qml tests"
74qbs config --unset profiles.qbs_autotests-android-qt.qbs.architectures
75qbs config profiles.qbs_autotests-android-qt.qbs.architecture armv7a
76
77qbs config --list
78
79tst_blackbox-android
80
81