diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build-qbs-with-qbs.sh | 10 | ||||
-rwxr-xr-x | scripts/cpu-count.sh | 50 | ||||
-rwxr-xr-x | scripts/install-qt.sh | 8 | ||||
-rwxr-xr-x | scripts/run-analyzer.sh | 9 | ||||
-rwxr-xr-x | scripts/test-baremetal.sh | 2 | ||||
-rwxr-xr-x | scripts/test-qbs.sh | 57 | ||||
-rwxr-xr-x | scripts/test-qt-for-android.sh | 2 |
7 files changed, 128 insertions, 10 deletions
diff --git a/scripts/build-qbs-with-qbs.sh b/scripts/build-qbs-with-qbs.sh index d1c1916f2..68832036a 100755 --- a/scripts/build-qbs-with-qbs.sh +++ b/scripts/build-qbs-with-qbs.sh @@ -78,6 +78,16 @@ if [ "$WITH_DOCS" -ne 0 ]; then qbs build -p "qbs documentation" ${BUILD_OPTIONS} fi +WITH_ARCHIVE=${WITH_ARCHIVE:-0} +if [ "$WITH_ARCHIVE" -ne 0 ]; then + qbs build -p dist ${BUILD_OPTIONS} "products.qbs archive.includeTopLevelDir:true" +fi + +WITH_TESTS=${WITH_TESTS:-1} +if [ "$WITH_TESTS" -eq 0 ]; then + exit 0 +fi + QMAKE_PATH=${QMAKE_PATH:-$(which qmake)} # diff --git a/scripts/cpu-count.sh b/scripts/cpu-count.sh new file mode 100755 index 000000000..ce6b1c82f --- /dev/null +++ b/scripts/cpu-count.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +############################################################################# +## +## Copyright (C) 2020 Ivan Komissarov <abbapoh@gmail.com> +## Contact: https://www.qt.io/licensing/ +## +## This file is part of Qbs. +## +## $QT_BEGIN_LICENSE:LGPL$ +## 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 Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 3 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL3 included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 3 requirements +## will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 2.0 or (at your option) the GNU General +## Public license version 3 or any later version approved by the KDE Free +## Qt Foundation. The licenses are as published by the Free Software +## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +## 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-2.0.html and +## https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +NPROC=`which nproc` +SYSCTL=`which sysctl` +CPU_COUNT=2 +if [ ! -z "$NPROC" ]; then # Linux + CPU_COUNT=`$NPROC --all` +elif [ ! -z "$SYSCTL" ]; then # macOS + CPU_COUNT=`$SYSCTL -n hw.physicalcpu_max` +fi + +echo $CPU_COUNT diff --git a/scripts/install-qt.sh b/scripts/install-qt.sh index be953e77d..a73300ae4 100755 --- a/scripts/install-qt.sh +++ b/scripts/install-qt.sh @@ -218,7 +218,7 @@ if ! ${FORCE_DOWNLOAD} && [ -f "${HASH_FILEPATH}" ]; then fi if ${INSTALLATION_IS_VALID}; then - echo "Already installed. Skipping download." + echo "Already installed. Skipping download." >&2 exit 0 fi @@ -313,7 +313,11 @@ for COMPONENT in ${COMPONENTS}; do # adjust the PATH variable. echo $(dirname "${CONF_FILE}") elif [[ "${COMPONENT}" =~ "qtcreator" ]]; then - echo "${INSTALL_DIR}/Tools/QtCreator/bin" + if [ "${HOST_OS}" == "mac_x64" ]; then + echo "${INSTALL_DIR}/Qt Creator.app/Contents/MacOS" + else + echo "${INSTALL_DIR}/Tools/QtCreator/bin" + fi fi done diff --git a/scripts/run-analyzer.sh b/scripts/run-analyzer.sh index a60bcc02e..d98fe2ab1 100755 --- a/scripts/run-analyzer.sh +++ b/scripts/run-analyzer.sh @@ -57,14 +57,7 @@ if [ -z "$RUN_CLANG_TIDY" ] || [ -z "$CLANG_TIDY" ]; then fi fi -NPROC=`which nproc` -SYSCTL=`which sysctl` -CPU_COUNT=2 -if [ ! -z "$NPROC" ]; then # Linux - CPU_COUNT=`$NPROC --all` -elif [ ! -z "$SYSCTL" ]; then # macOS - CPU_COUNT=`$SYSCTL -n hw.ncpu` -fi +CPU_COUNT=$("$(dirname "$0")"/cpu-count.sh) BUILD_OPTIONS="\ ${QBS_BUILD_PROFILE:+profile:${QBS_BUILD_PROFILE}} \ diff --git a/scripts/test-baremetal.sh b/scripts/test-baremetal.sh index 5273d4ba9..985a5eac4 100755 --- a/scripts/test-baremetal.sh +++ b/scripts/test-baremetal.sh @@ -40,6 +40,8 @@ set -eu ## ############################################################################# +export LSAN_OPTIONS="suppressions=$( cd "$(dirname "$0")" ; pwd -P )/address-sanitizer-suppressions.txt:print_suppressions=0" + export PATH="$1:$PATH" export QBS_AUTOTEST_ALWAYS_LOG_STDERR=true diff --git a/scripts/test-qbs.sh b/scripts/test-qbs.sh new file mode 100755 index 000000000..608499f43 --- /dev/null +++ b/scripts/test-qbs.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +############################################################################# +## +## Copyright (C) 2020 Ivan Komissarov <abbapoh@gmail.com> +## Contact: https://www.qt.io/licensing/ +## +## This file is part of Qbs. +## +## $QT_BEGIN_LICENSE:LGPL$ +## 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 Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 3 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL3 included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 3 requirements +## will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 2.0 or (at your option) the GNU General +## Public license version 3 or any later version approved by the KDE Free +## Qt Foundation. The licenses are as published by the Free Software +## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +## 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-2.0.html and +## https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +set -eu + +# +# Qbs is built with the address sanitizer enabled. +# Suppress findings in some parts of Qbs / dependencies. +# +export LSAN_OPTIONS="suppressions=$( cd "$(dirname "$0")" ; pwd -P )/address-sanitizer-suppressions.txt:print_suppressions=0" + +export PATH="$1:$PATH" + +qbs-config --list profiles + +CPUS=$("$(dirname "$0")"/cpu-count.sh) + +export QBS_AUTOTEST_PROFILE=${QBS_AUTOTEST_PROFILE:-qt} +echo "Running Qbs tests (${CPUS} jobs in parallel)." +find $1 -name "tst_*" | xargs -I{} -n1 -P${CPUS} bash -c 'export LOG=$(mktemp) ; $({} > ${LOG} 2>&1) ; export RESULT=$? ; cat ${LOG} ; exit ${RESULT}' diff --git a/scripts/test-qt-for-android.sh b/scripts/test-qt-for-android.sh index 44a64db21..06d89cedf 100755 --- a/scripts/test-qt-for-android.sh +++ b/scripts/test-qt-for-android.sh @@ -42,6 +42,8 @@ set -eu export PATH="$1:$PATH" +export LSAN_OPTIONS="suppressions=$( cd "$(dirname "$0")" ; pwd -P )/address-sanitizer-suppressions.txt:print_suppressions=0" + # # These are set outside of this script, for instance in the Docker image # |