summaryrefslogtreecommitdiff
path: root/scripts/linux/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/linux/run.sh')
-rwxr-xr-xscripts/linux/run.sh75
1 files changed, 75 insertions, 0 deletions
diff --git a/scripts/linux/run.sh b/scripts/linux/run.sh
new file mode 100755
index 0000000000..c4731b97ec
--- /dev/null
+++ b/scripts/linux/run.sh
@@ -0,0 +1,75 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+BUILDTYPE=${BUILDTYPE:-Release}
+
+source ./scripts/travis_helper.sh
+
+# Add Mason to PATH
+export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
+
+# Set the core file limit to unlimited so a core file is generated upon crash
+ulimit -c unlimited -S
+
+################################################################################
+# X Server setup
+################################################################################
+
+# Start the mock X server
+if [ -f /etc/init.d/xvfb ] ; then
+ mapbox_time "start_xvfb" \
+ sh -e /etc/init.d/xvfb start
+ sleep 2 # sometimes, xvfb takes some time to start up
+fi
+
+# Make sure we're connecting to xvfb
+export DISPLAY=:99.0
+
+# Make sure we're loading the 10.4.3 libs we installed manually
+export LD_LIBRARY_PATH="`mason prefix mesa 10.4.3`/lib:${LD_LIBRARY_PATH:-}"
+
+mapbox_time "glxinfo" \
+glxinfo
+
+################################################################################
+# Build
+################################################################################
+
+mapbox_time "checkout_styles" \
+git submodule update --init styles
+
+mapbox_time "compile_program" \
+make linux -j${JOBS} BUILDTYPE=${BUILDTYPE}
+
+mapbox_time "compile_tests" \
+make test -j${JOBS} BUILDTYPE=${BUILDTYPE}
+
+################################################################################
+# Test
+################################################################################
+
+mapbox_time "checkout_test_suite" \
+git submodule update --init test/suite
+
+mapbox_time "run_tests" \
+make test-* BUILDTYPE=${BUILDTYPE}
+
+mapbox_time "compare_results" \
+./scripts/compare_images.sh
+
+################################################################################
+# Deploy
+################################################################################
+
+if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
+ # Install and add awscli to PATH for uploading the results
+ mapbox_time "install_awscli" \
+ pip install --user awscli
+ export PATH="`python -m site --user-base`/bin:${PATH}"
+
+ mapbox_time_start "deploy_results"
+ (cd ./test/suite/ && ./bin/deploy_results.sh)
+ mapbox_time_finish
+fi