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

91 lines
2.1 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
ccache -M 500M
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
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_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 \
-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
#######
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}
2017-09-21 09:07:37 +02:00
echo "travis_fold:end:ninja-build.1"
2017-08-07 21:08:35 +02:00
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