summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-03-13 12:05:51 +0100
committerKonstantin Käfer <mail@kkaefer.com>2015-03-13 12:06:11 +0100
commit5e40f72b7cd5fd937ba8b628678cd5122298e8e5 (patch)
treeb30acdb825a4c633dd81313eeae429664233a660
parent5225a2ce5b7cd4fb6b08d1746c83455d64ef2c94 (diff)
downloadqtlocation-mapboxgl-5e40f72b7cd5fd937ba8b628678cd5122298e8e5.tar.gz
scripts for running linux tests with docker
-rwxr-xr-xconfigure14
-rw-r--r--docker/linux/Dockerfile19
-rw-r--r--docker/linux/run-clang.sh15
-rwxr-xr-xdocker/linux/run-gcc.sh15
-rwxr-xr-xdocker/linux/test.sh26
-rw-r--r--gyp/core.gypi3
-rw-r--r--gyp/headless-glx.gypi6
-rw-r--r--gyp/platform-osx.gypi2
-rw-r--r--linux/mapboxgl-app.gyp5
-rwxr-xr-xscripts/travis_before_install.sh3
-rw-r--r--test/test.gyp9
11 files changed, 101 insertions, 16 deletions
diff --git a/configure b/configure
index f80c8b11c6..a60fd52d04 100755
--- a/configure
+++ b/configure
@@ -50,6 +50,12 @@ case ${MASON_PLATFORM} in
;;
esac
+if [ ${MASON_PLATFORM} == 'linux' ] ; then
+ MESA_VERSION=10.4.3
+ mason install mesa ${MESA_VERSION}
+ export PKG_CONFIG_PATH=`mason prefix mesa ${MESA_VERSION}`/lib/pkgconfig
+fi
+
function abort { >&2 echo -e "\033[1m\033[31m$1\033[0m"; exit 1; }
if [ -z ${CONFIG_FILE} ]; then
@@ -121,6 +127,14 @@ if [ ! -z ${GLFW_VERSION} ]; then
CONFIG+=" 'glfw3_ldflags%': $(quote_flags $(mason ldflags glfw ${GLFW_VERSION})),"$LN
fi
+if [ ${MASON_PLATFORM} == 'linux' ]; then
+ CONFIG+=" 'opengl_cflags%': $(quote_flags $(pkg-config gl --cflags)),"$LN
+ CONFIG+=" 'opengl_ldflags%': $(quote_flags $(pkg-config gl --libs)),"$LN
+else
+ CONFIG+=" 'opengl_cflags%': $(quote_flags),"$LN
+ CONFIG+=" 'opengl_ldflags%': $(quote_flags),"$LN
+fi
+
if [ ! -z ${LIBPNG_VERSION} ]; then
mason install libpng ${LIBPNG_VERSION}
CONFIG+=" 'png_static_libs%': $(quote_flags $(mason static_libs libpng ${LIBPNG_VERSION})),"$LN
diff --git a/docker/linux/Dockerfile b/docker/linux/Dockerfile
new file mode 100644
index 0000000000..0d23fe1e79
--- /dev/null
+++ b/docker/linux/Dockerfile
@@ -0,0 +1,19 @@
+FROM ubuntu:12.04
+
+RUN apt-get update -y && \
+ apt-get install -y build-essential git-core python-pip python-software-properties software-properties-common && \
+ rm -rf /var/lib/apt/lists/*
+
+RUN add-apt-repository --yes ppa:ubuntu-toolchain-r/test && \
+ add-apt-repository --yes ppa:boost-latest/ppa && \
+ apt-get update -y && \
+ apt-get -y install gcc-4.8 g++-4.8 curl zlib1g-dev automake gdb libtool xutils-dev make cmake pkg-config python-pip libboost1.55-dev libcurl4-openssl-dev libpng-dev libsqlite3-dev mesa-utils libxi-dev x11proto-randr-dev x11proto-xext-dev libxrandr-dev x11proto-xf86vidmode-dev libxxf86vm-dev libxcursor-dev libxinerama-dev xvfb llvm-3.4 && \
+ pip install awscli
+
+RUN apt-get install -y imagemagick
+
+RUN useradd -ms /bin/bash mapbox
+
+USER mapbox
+ENV HOME /home/mapbox
+WORKDIR /home/mapbox
diff --git a/docker/linux/run-clang.sh b/docker/linux/run-clang.sh
new file mode 100644
index 0000000000..cb9f6f417f
--- /dev/null
+++ b/docker/linux/run-clang.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+docker build \
+ -t mapbox/gl-native:linux \
+ docker/linux
+
+docker run \
+ -i \
+ -e "CXX=clang++" \
+ -v `pwd`:/home/mapbox/build \
+ -t mapbox/gl-native:linux \
+ build/docker/linux/test.sh
diff --git a/docker/linux/run-gcc.sh b/docker/linux/run-gcc.sh
new file mode 100755
index 0000000000..093771f1a4
--- /dev/null
+++ b/docker/linux/run-gcc.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+docker build \
+ -t mapbox/gl-native:linux \
+ docker/linux
+
+docker run \
+ -i \
+ -e "CXX=g++" \
+ -v `pwd`:/home/mapbox/build \
+ -t mapbox/gl-native:linux \
+ build/docker/linux/test.sh
diff --git a/docker/linux/test.sh b/docker/linux/test.sh
new file mode 100755
index 0000000000..9ef9bf51f5
--- /dev/null
+++ b/docker/linux/test.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+export TRAVIS_OS_NAME=linux
+
+cd build
+
+source ./scripts/local_mason.sh
+mason install mesa 10.4.3
+export LD_LIBRARY_PATH=`mason prefix mesa 10.4.3`/lib
+
+export DISPLAY=:99.0
+Xvfb :99 -ac -screen 0 1024x768x24 &
+
+if [[ ${CXX} == "g++" ]]; then
+ export CXX="g++-4.8"
+ export CC="gcc-4.8"
+fi
+
+source ./scripts/install_node.sh
+
+make linux -j`nproc`
+make test-* -j`nproc`
+./scripts/compare_images.sh
diff --git a/gyp/core.gypi b/gyp/core.gypi
index 9a3b07d0bb..246419371c 100644
--- a/gyp/core.gypi
+++ b/gyp/core.gypi
@@ -29,14 +29,17 @@
'variables': {
'cflags_cc': [
'<@(uv_cflags)',
+ '<@(opengl_cflags)',
'<@(boost_cflags)',
],
'cflags': [
'<@(uv_cflags)',
+ '<@(opengl_cflags)',
'-fPIC'
],
'ldflags': [
'<@(uv_ldflags)',
+ '<@(opengl_ldflags)',
],
'libraries': [
'<@(uv_static_libs)',
diff --git a/gyp/headless-glx.gypi b/gyp/headless-glx.gypi
index 06062be75f..5b9f3e136f 100644
--- a/gyp/headless-glx.gypi
+++ b/gyp/headless-glx.gypi
@@ -13,6 +13,12 @@
'include_dirs': [
'../include',
],
+
+ 'cflags_cc': [ '<@(opengl_cflags)' ],
+
+ 'link_settings': {
+ 'libraries': [ '<@(opengl_ldflags)' ],
+ },
},
],
}
diff --git a/gyp/platform-osx.gypi b/gyp/platform-osx.gypi
index 011f26e836..39e18bb839 100644
--- a/gyp/platform-osx.gypi
+++ b/gyp/platform-osx.gypi
@@ -29,6 +29,8 @@
'-framework Foundation',
'-framework ImageIO',
'-framework CoreServices',
+ '-framework OpenGL',
+ '-framework ApplicationServices',
],
},
diff --git a/linux/mapboxgl-app.gyp b/linux/mapboxgl-app.gyp
index e7fc27da10..433a061e43 100644
--- a/linux/mapboxgl-app.gyp
+++ b/linux/mapboxgl-app.gyp
@@ -52,11 +52,6 @@
'libraries': [ '<@(libraries)', '<@(ldflags)' ],
}]
],
-
- 'copies': [{
- 'files': [ '../styles/styles' ],
- 'destination': '<(PRODUCT_DIR)'
- }],
},
],
}
diff --git a/scripts/travis_before_install.sh b/scripts/travis_before_install.sh
index f837e74161..7b0b7ea873 100755
--- a/scripts/travis_before_install.sh
+++ b/scripts/travis_before_install.sh
@@ -31,9 +31,6 @@ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
x11proto-xf86vidmode-dev libxxf86vm-dev \
libxcursor-dev libxinerama-dev \
llvm-3.4 # required for mesa
-
- mapbox_time "install_mesa" \
- mason install mesa 10.4.3
fi
mapbox_time "install_awscli" \
diff --git a/test/test.gyp b/test/test.gyp
index 9e542aec2f..719207a02e 100644
--- a/test/test.gyp
+++ b/test/test.gyp
@@ -67,22 +67,15 @@
],
'libraries': [
'<@(uv_static_libs)',
- '<@(glfw3_static_libs)',
- '<@(sqlite3_static_libs)',
- '<@(zlib_static_libs)',
- '<@(curl_static_libs)',
],
'variables': {
'cflags_cc': [
'<@(uv_cflags)',
+ '<@(opengl_cflags)',
'<@(boost_cflags)',
],
'ldflags': [
'<@(uv_ldflags)',
- '<@(glfw3_ldflags)',
- '<@(sqlite3_ldflags)',
- '<@(zlib_ldflags)',
- '<@(curl_ldflags)',
],
},
'conditions': [