aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2020-05-14 21:59:58 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2020-05-19 10:49:51 +0000
commitd042eb09d9aed7a146bf6e129e2142b16ff2ce42 (patch)
tree9654e8672c819e24a499ba1d40a6891c70283bf8
parent49948ff97d49558a512c89ffd19e4812b625c453 (diff)
build-qbs-with-qbs.sh: Add more flexibility for the autotest profile
This patchset adds QBS_AUTOTEST_QMAKE_PATH and QBS_AUTOTEST_BASE_PROFILE variables that could be used to configure the profile that is used when running autotests Change-Id: Ifc32d397c08eefb7e8b96cf387031db2ab693cbc Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rwxr-xr-xscripts/build-qbs-with-qbs.sh32
1 files changed, 22 insertions, 10 deletions
diff --git a/scripts/build-qbs-with-qbs.sh b/scripts/build-qbs-with-qbs.sh
index 856cf71b6..d84202627 100755
--- a/scripts/build-qbs-with-qbs.sh
+++ b/scripts/build-qbs-with-qbs.sh
@@ -45,11 +45,19 @@ set -e
#
export LSAN_OPTIONS="suppressions=$( cd "$(dirname "$0")" ; pwd -P )/address-sanitizer-suppressions.txt:print_suppressions=0"
+if [ -z "${QBS_BUILD_PROFILE}" ]; then
+ QBS_BUILD_PROFILE=$(qbs config defaultProfile | cut -d: -f2 | tr -d '[:space:]')
+fi
+if [ -z "${QBS_BUILD_PROFILE}" ]; then
+ echo "Either QBS_BUILD_PROFILE or a defaultProfile must be set."
+ exit 1
+fi
+
#
# Additional build options
#
BUILD_OPTIONS="\
- ${QBS_BUILD_PROFILE:+profile:${QBS_BUILD_PROFILE}} \
+ profile:${QBS_BUILD_PROFILE} \
modules.qbsbuildconfig.enableAddressSanitizer:true \
modules.qbsbuildconfig.enableProjectFileUpdates:true \
modules.qbsbuildconfig.enableUnitTests:true \
@@ -72,6 +80,8 @@ if [ "$WITH_DOCS" -ne 0 ]; then
qbs build -p "qbs documentation" ${BUILD_OPTIONS}
fi
+QMAKE_PATH=${QMAKE_PATH:-$(which qmake)}
+
#
# Set up profiles for the freshly built Qbs if not
# explicitly specified otherwise
@@ -81,6 +91,8 @@ if [ -z "${QBS_AUTOTEST_PROFILE}" ]; then
export QBS_AUTOTEST_PROFILE=autotestprofile
export QBS_AUTOTEST_SETTINGS_DIR=`mktemp -d 2>/dev/null || mktemp -d -t 'qbs-settings'`
+ QBS_AUTOTEST_QMAKE_PATH=${QBS_AUTOTEST_QMAKE_PATH:-${QMAKE_PATH}}
+
RUN_OPTIONS="\
--settings-dir ${QBS_AUTOTEST_SETTINGS_DIR} \
"
@@ -91,20 +103,20 @@ if [ -z "${QBS_AUTOTEST_PROFILE}" ]; then
qbs run -p qbs_app ${BUILD_OPTIONS} -- setup-qt \
${RUN_OPTIONS} \
- "${QMAKE_PATH:-$(which qmake)}" ${QBS_AUTOTEST_PROFILE}
+ "${QBS_AUTOTEST_QMAKE_PATH}" ${QBS_AUTOTEST_PROFILE}
# Make sure that the Qt profile uses the same toolchain profile
# that was used for building in case a custom QBS_BUILD_PROFILE
# was set. Otherwise setup-qt automatically uses the default
# toolchain profile.
- if [ ! -z "${QBS_BUILD_PROFILE}" ]; then
- QBS_BUILD_BASE_PROFILE=$(qbs config profiles.${QBS_BUILD_PROFILE}.baseProfile | cut -d: -f2)
- if [ ! -z "${QBS_BUILD_BASE_PROFILE}" ]; then
- echo "Setting base profile for ${QBS_AUTOTEST_PROFILE} to ${QBS_BUILD_BASE_PROFILE}"
- qbs run -p qbs_app ${BUILD_OPTIONS} -- config \
- ${RUN_OPTIONS} \
- profiles.${QBS_AUTOTEST_PROFILE}.baseProfile ${QBS_BUILD_BASE_PROFILE}
- fi
+ if [ -z "${QBS_AUTOTEST_BASE_PROFILE}" ]; then
+ QBS_AUTOTEST_BASE_PROFILE=$(qbs config profiles.${QBS_BUILD_PROFILE}.baseProfile | cut -d: -f2)
+ fi
+ if [ ! -z "${QBS_AUTOTEST_BASE_PROFILE}" ]; then
+ echo "Setting base profile for ${QBS_AUTOTEST_PROFILE} to ${QBS_AUTOTEST_BASE_PROFILE}"
+ qbs run -p qbs_app ${BUILD_OPTIONS} -- config \
+ ${RUN_OPTIONS} \
+ profiles.${QBS_AUTOTEST_PROFILE}.baseProfile ${QBS_AUTOTEST_BASE_PROFILE}
fi
qbs run -p qbs_app ${BUILD_OPTIONS} -- config \