forked from louis-langholtz/Box2D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
135 lines (121 loc) · 6.29 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# This file configures the build and run environment on https://travis-ci.org/
# Specify the operating systems on which to test for.
os:
- linux
# For details on building a C++ project see: https://docs.travis-ci.com/user/languages/cpp/
language: cpp
# Specifiy which compiler or compilers to test against.
# For details, see https://docs.travis-ci.com/user/languages/cpp/#Choosing-compilers-to-test-against
compiler:
- clang
- gcc
# Define build environment variables.
# Each variable causes an individual build.
env:
- REALNUM_TYPE=float
- REALNUM_TYPE=double
# Specify explicitly which branches to build or not build
# For details see: https://docs.travis-ci.com/user/customizing-the-build/#Building-Specific-Branches
branches:
only:
- dev
# Specify which OS X image to use.
# "xcode8" is supposed to provide a macosx10.11 SK preinstalled.
# For details see: https://docs.travis-ci.com/user/osx-ci-environment/
osx_image: xcode8
xcode_project: Build/xcode5/Box2D.xcodeproj
xcode_scheme: UnitTest
sudo: false
# https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz
# Specify which "apt" packages to install/update.
# For white-listed aliases, see https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
#
# Ideally there are usable packages for GLFW version 3 or GLEW version 2 but
# I haven't found usable ones. The closest I got was from a source that
# appeared to cause package conflicts. So these are dealt with later in the
# install stage by downloading, building and installing them the manual way.
#
addons:
apt:
sources:
- deadsnakes
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
- llvm-toolchain-precise-3.7
packages:
- build-essential
- cmake
- cmake-data
- clang-3.7
- g++-6
- gcc-6
- xorg-dev
- libx11-dev
- libXmu-dev
- libXi-dev
- libgl1-mesa-dev
- libosmesa-dev
- lcov
- ggcov
before_install:
- gem install coveralls-lcov
# Install stage. Setup dependencies that can't be setup as addon packages.
#
# I'd prefer that GLFW and GLEW get installed as packages but I didn't find
# usable packages for GLFW version 3 (or newer) and GLEW version 2 (or newer).
# Both of which are required for the Box2D Testbed and ONLY the Testbed.
#
# Additional notes:
# Linux seems to usually support "sha256sum". OS X meanwhile calls it "shasum".
# For dumping compiler macros: $CXX -dM -E - < /dev/null | sort
# Don't use backslashes for line folding/breaking; they don't work for that.
#
install:
- |
if [ "$CXX" = "g++" ]
then
export CXX="g++-6" CC="gcc-6"
wget http://downloads.sourceforge.net/ltp/lcov-1.13.tar.gz
tar xf lcov-1.13.tar.gz
mkdir -p /tmp/usr
make -C lcov-1.13/ PREFIX=/tmp/usr install
fi
- if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi
- |
echo CXX=$CXX HOME=$HOME TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR
cmake --version
export SOURCE_ROOT="${TRAVIS_BUILD_DIR}" BUILD_ROOT="${TRAVIS_BUILD_DIR}-Build"
BOX2D_BUILD_OPTIONS="-DBOX2D_BUILD_UNIT_TESTS=ON -DBOX2D_BUILD_HELLOWORLD=ON -DBOX2D_BUILD_TESTBED=ON"
- |
if [ "${REALNUM_TYPE}foo" != "foo" ]; then
BOX2D_BUILD_OPTIONS="$BOX2D_BUILD_OPTIONS -DBOX2D_REALNUM_TYPE=$REALNUM_TYPE"
fi
echo $BOX2D_BUILD_OPTIONS
- git clone https://github.com/louis-langholtz/units.git && wget https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.bz2 -O /tmp/boost_1_63_0.tar.bz2 && sha256sum /tmp/boost_1_63_0.tar.bz2 && echo "Expect SHA256 Hash of beae2529f759f6b3bf3f4969a19c2e9d6f0c503edcb2de4a61d1428519fcb3b0" && export BOOST_INC_DST=/tmp/boost_1_63_0/include/boost BOOST_SRC=$HOME/boost-src && mkdir -p $BOOST_SRC $BOOST_INC_DST && pushd $BOOST_SRC && tar --bzip2 -xf /tmp/boost_1_63_0.tar.bz2 && cp -a boost_1_63_0/boost/* $BOOST_INC_DST && popd && pushd $BOOST_INC_DST && mv units units.old && ln -s $HOME/units/include/boost/units . && popd
- |
export GLFW_URL=https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.zip
mkdir /tmp/glfw && pushd /tmp/glfw && curl --location --remote-name $GLFW_URL && md5sum *.zip && echo "Expect MD5 hash of 824c99eea073bdd6d2fec76b538f79af" && unzip -q *.zip && rm *.zip && mkdir ../glfw-build && cd ../glfw-build && cmake -DCMAKE_INSTALL_PREFIX=/tmp/usr ../glfw/* && make && make install && popd
- |
export GLEW_URL=https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0.zip
mkdir /tmp/glew && pushd /tmp/glew && curl --location --remote-name $GLEW_URL && md5sum *.zip && echo "Expect MD5 hash of 54c913d0c00726fb028d089ad1664ede" && unzip -q *.zip && rm *.zip && cd * && make && make DESTDIR=/tmp install && popd
script:
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "clang++-3.7" ]]; then (pwd && mkdir -p $BUILD_ROOT && cd $BUILD_ROOT && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/tmp/usr -DCMAKE_LIBRARY_PATH=/tmp/usr/lib $BOX2D_BUILD_OPTIONS $SOURCE_ROOT && make && cd UnitTests && ./UnitTests --gtest_filter=-Dump.OneBodyWorld:StackAllocator.slower_than_mallocfree ); fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++-6" ]]; then (pwd && mkdir -p $BUILD_ROOT && cd $BUILD_ROOT && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/tmp/usr -DCMAKE_LIBRARY_PATH=/tmp/usr/lib -DBOX2D_ENABLE_COVERAGE=ON $BOX2D_BUILD_OPTIONS $SOURCE_ROOT && make && cd UnitTests && ./UnitTests --gtest_filter=-Dump.OneBodyWorld:StackAllocator.slower_than_mallocfree:Math.LengthFasterThanHypot ); fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then (cd Box2D && xcodebuild -project Build/xcode5/Box2D.xcodeproj -list); fi
# Notes:
# .gcno files are binary files.
after_success:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++-6" ]]; then
export PATH=/tmp/usr/bin:$PATH
pwd && ls -laF . /usr/bin/gcov*
cd $BUILD_ROOT && pwd
lcov --gcov-tool /usr/bin/gcov-6 --directory Box2D --directory UnitTests --base-directory $SOURCE_ROOT --capture --output-file coverage.info
echo "Lcov exited with status $?"
ls -laF coverage.info
lcov --gcov-tool /usr/bin/gcov-6 --remove coverage.info '*/UnitTests/*' -o coverage.info
lcov --gcov-tool /usr/bin/gcov-6 --remove coverage.info '/usr/include/*' -o coverage.info
ls -laF coverage.info
cd $SOURCE_ROOT && pwd
coveralls-lcov $BUILD_ROOT/coverage.info
fi