QGIS/.ci/travis/macos/script.sh

45 lines
1.8 KiB
Bash
Raw Normal View History

2018-06-05 11:22:18 +02:00
#!/usr/bin/env bash
2016-06-03 10:16:00 +02:00
###########################################################################
# script.sh
# ---------------------
# Date : August 2015
# Copyright : (C) 2015 by Nyall Dawson
# Email : nyall dot dawson at gmail dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
2017-04-23 13:08:58 +02:00
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2018-06-01 08:21:48 +10:00
echo "$PATH"
2016-03-17 09:48:07 +01:00
export PATH=/usr/bin:${PATH}
2017-05-11 08:22:37 +02:00
ccache -M 500M
ccache -z
2017-04-23 13:08:58 +02:00
2017-04-26 10:34:41 +02:00
# Calculate the timeout for the tests.
# The tests should be aborted before travis times out, in order to allow uploading
# the ccache and therefore speedup subsequent e builds.
2017-04-23 13:08:58 +02:00
#
2017-04-26 10:34:41 +02:00
# Travis will kill the job after approx 48 minutes, we subtract 8 minutes for
# uploading and initialization (40) and subtract the bootstrapping time from that.
TIMEOUT=$((40 * 60 - $(date +%s) + $(cat /tmp/travis_timestamp)))
2017-04-26 16:13:11 +02:00
export CTEST_BUILD_COMMAND=/usr/local/bin/ninja
2017-08-07 20:55:41 +02:00
export CTEST_BUILD_DIR=${TRAVIS_BUILD_DIR}
2017-04-26 16:13:11 +02:00
2018-06-21 12:49:45 +10:00
gtimeout "${TIMEOUT}s" ctest -V -E "$(cat "${DIR}"/blacklist.txt | gsed -r '/^(#.*?)?$/d' | gpaste -sd '|' -)" -S "${DIR}/../travis.ctest" --output-on-failure
2017-04-23 13:08:58 +02:00
rv=$?
2017-05-01 13:11:36 +02:00
if [ $rv -eq 124 ] ; then
2017-05-01 22:10:30 +02:00
printf '\n\n\033[0;33mBuild and test timeout. Please restart the build for meaningful results.\033[0m\n'
2017-04-23 13:08:58 +02:00
fi
exit $rv