QGIS/.ci/travis/linux/docker-build-test.sh

102 lines
2.4 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2017-09-21 09:07:37 +02:00
set -e
2017-09-21 09:07:37 +02:00
##############
# Setup ccache
##############
export CCACHE_TEMPDIR=/tmp
2017-10-29 10:44:08 +01:00
ccache -M 1G
2017-10-29 09:51:51 +01:00
# Temporarily uncomment to debug ccache issues
# export CCACHE_LOGFILE=/tmp/cache.debug
ccache -z
2017-09-21 09:07:37 +02:00
############################
# Setup the (c)test environment
############################
export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
2017-11-09 21:33:38 +01:00
export SEGFAULT_SIGNALS="abrt segv"
2017-09-21 09:07:37 +02:00
export CTEST_BUILD_COMMAND="/usr/bin/ninja"
export CTEST_PARALLEL_LEVEL=1
2017-08-08 09:13:16 +02:00
2017-10-07 11:40:21 +02:00
##############################
# Variables for output styling
##############################
bold=$(tput bold)
endbold=$(tput sgr0)
2017-09-21 09:07:37 +02:00
###########
# Configure
###########
2017-10-07 09:42:05 +02:00
pushd /root/QGIS > /dev/null
2017-09-21 09:07:37 +02:00
mkdir -p build
2017-10-07 09:42:05 +02:00
pushd build > /dev/null
2017-10-07 09:50:19 +02:00
echo "travis_fold:start:cmake"
2017-10-07 11:40:21 +02:00
echo "${bold}Running cmake...${endbold}"
cmake \
-GNinja \
-DWITH_3D=ON \
-DWITH_STAGED_PLUGINS=ON \
-DWITH_GRASS=OFF \
-DSUPPRESS_QT_WARNINGS=ON \
-DENABLE_MODELTEST=ON \
-DENABLE_PGTEST=ON \
-DWITH_QSPATIALITE=ON \
-DWITH_QWTPOLAR=OFF \
-DWITH_APIDOC=OFF \
-DWITH_ASTYLE=OFF \
-DWITH_DESKTOP=ON \
-DWITH_BINDINGS=ON \
2017-11-03 17:13:47 +01:00
-DWITH_SERVER=ON \
-DDISABLE_DEPRECATED=ON \
-DCXX_EXTRA_FLAGS=${CLANG_WARNINGS} ..
2017-10-07 09:50:19 +02:00
echo "travis_fold:end:cmake"
2017-09-21 09:07:37 +02:00
#######
# Build
#######
2018-01-03 15:16:18 +01:00
# echo "travis_fold:start:ninja-build.1"
2017-10-07 11:40:21 +02:00
echo "${bold}Building QGIS...${endbold}"
2017-10-07 09:50:19 +02:00
${CTEST_BUILD_COMMAND}
2018-01-03 15:16:18 +01:00
# echo "travis_fold:end:ninja-build.1"
2017-08-07 21:08:35 +02:00
2017-10-29 09:51:51 +01:00
# Temporarily uncomment to debug ccache issues
# echo "travis_fold:start:ccache-debug"
# cat /tmp/cache.debug
# echo "travis_fold:end:ccache-debug"
2017-09-21 09:07:37 +02:00
############################
# Restore postgres test data
2017-09-21 09:07:37 +02:00
############################
printf "[qgis_test]\nhost=postgres\nport=5432\ndbname=qgis_test\nuser=docker\npassword=docker" > ~/.pg_service.conf
export PGUSER=docker
export PGHOST=postgres
export PGPASSWORD=docker
export PGDATABASE=qgis_test
2017-10-07 09:42:05 +02:00
pushd /root/QGIS > /dev/null
/root/QGIS/tests/testdata/provider/testdata_pg.sh
2017-10-07 09:42:05 +02:00
popd > /dev/null # /root/QGIS
2017-09-21 09:07:37 +02:00
###########
# Run tests
###########
2017-09-20 12:11:19 +02:00
python3 /root/QGIS/.ci/travis/scripts/ctest2travis.py xvfb-run ctest -V -E "$(cat /root/QGIS/.ci/travis/linux/blacklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)" -S /root/QGIS/.ci/travis/travis.ctest --output-on-failure
2017-09-21 09:07:37 +02:00
########################
# Show ccache statistics
########################
2017-10-07 11:43:52 +02:00
echo "travis_fold:start:ccache.stats"
echo "ccache statistics"
ccache -s
2017-10-07 11:43:52 +02:00
echo "travis_fold:end:ccache.stats"
2017-10-07 09:42:05 +02:00
popd > /dev/null # build
popd > /dev/null # /root/QGIS
2017-09-28 11:43:30 +02:00
[ -r /tmp/ctest-important.log ] && cat /tmp/ctest-important.log || true