fix automated headless testing on travis

This commit is contained in:
Konstantin Käfer
2014-07-09 12:37:59 -07:00
parent 5fe36a3cb0
commit d0d68d08f4
13 changed files with 85 additions and 68 deletions

12
scripts/deploy_results.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e
set -o pipefail
aws s3 cp test/fixtures/styles/ s3://mapbox-gl-testing/headless/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/ --acl public-read --recursive --exclude "*" --include "*.png"
cd test/fixtures/styles
for FILE in *.png ; do
echo http://mapbox-gl-testing.s3.amazonaws.com/headless/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/$FILE
done
cd ../../..

31
scripts/flags.sh Normal file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
# use g++ that supports c++11
if [[ ${CXX} == "g++" ]]; then
export CXX="g++-4.8" ;
fi
# If building in debug then turn on sanitizers.
# They should both work with latest g++/clang++
# but it's not worth a standalone matrix so here
# we just test address->gcc and thread->clang for
# some limited coverage
if [[ ${BUILDTYPE} == "Debug" ]]; then
if [[ ${CXX} == "g++" ]]; then
export CXXFLAGS="-fsanitize=address ${CXXFLAGS}"
export CFLAGS="-fsanitize=address ${CFLAGS}"
export LDFLAGS="-fsanitize=address ${LDFLAGS}"
elif [[ ${CXX} == "clang++" ]]; then
export CXXFLAGS="-fsanitize=thread -fPIC ${CXXFLAGS}"
export CFLAGS="-fsanitize=thread ${CFLAGS}"
export LDFLAGS="-fsanitize=thread -pie ${LDFLAGS}"
fi
fi
fi
# turn off a few warnings
export CXXFLAGS="-Wno-unknown-warning-option -Wno-unused-local-typedefs -Wno-unknown-pragmas ${CXXFLAGS}";

View File

@@ -3,8 +3,10 @@
set -e
set -o pipefail
cd build/$BUILDTYPE
BUILDTYPE="${BUILDTYPE:-Release}"
for TEST in test_* ; do
./$TEST
cd build/${BUILDTYPE}
for TEST in ./test_* ; do
${TEST}
done

View File

@@ -3,15 +3,6 @@
set -e
set -o pipefail
# enable testing locally (not on travis)
if [[ "${TRAVIS_OS_NAME:-false}" == false ]]; then
if [[ $(uname -s) == "Darwin" ]]; then
TRAVIS_OS_NAME="osx"
elif [[ $(uname -s) == "Linux" ]]; then
TRAVIS_OS_NAME="linux"
fi
fi
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
if [[ `lsb_release -r` =~ "12.04" ]]; then
@@ -19,36 +10,10 @@ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
fi
sudo apt-get update -y
sudo apt-get -y install gcc-4.8 g++-4.8
sudo apt-get -y install git build-essential zlib1g-dev automake libtool xutils-dev make cmake pkg-config
sudo apt-get -y install git build-essential zlib1g-dev automake libtool xutils-dev make cmake pkg-config python-pip
sudo apt-get -y install libxi-dev libglu1-mesa-dev x11proto-randr-dev x11proto-xext-dev libxrandr-dev x11proto-xf86vidmode-dev libxxf86vm-dev libxcursor-dev
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
# use g++ that supports c++11
if [[ ${CXX} == "g++" ]]; then
export CXX="g++-4.8" ;
fi
# If building in debug then turn on sanitizers.
# They should both work with latest g++/clang++
# but it's not worth a standalone matrix so here
# we just test address->gcc and thread->clang for
# some limited coverage
if [[ ${BUILDTYPE} == "Debug" ]]; then
if [[ ${CXX} == "g++" ]]; then
export CXXFLAGS="-fsanitize=address ${CXXFLAGS}"
export CFLAGS="-fsanitize=address ${CFLAGS}"
export LDFLAGS="-fsanitize=address ${LDFLAGS}"
elif [[ ${CXX} == "clang++" ]]; then
export CXXFLAGS="-fsanitize=thread -fPIC ${CXXFLAGS}"
export CFLAGS="-fsanitize=thread ${CFLAGS}"
export LDFLAGS="-fsanitize=thread -pie ${LDFLAGS}"
fi
fi
sudo pip install awscli
elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
brew install autoconf automake libtool makedepend cmake pkg-config node git
fi
# turn off a few warnings
export CXXFLAGS="-Wno-unknown-warning-option -Wno-unused-local-typedefs -Wno-unknown-pragmas ${CXXFLAGS}";