-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.travis.yml
103 lines (88 loc) · 2.88 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
sudo: false
language: cpp
os:
- linux
compiler:
- clang
- gcc
matrix:
include:
- os: osx
language: cpp
osx_image: xcode7.2
compiler: clang
- os: osx
language: cpp
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- xmlto
install:
- |-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew install xmlto
brew unlink boost
brew install boost
fi
# Prepare for local installs
- export LOCAL_INSTALL="$HOME/local"; mkdir "$LOCAL_INSTALL" && export PKG_CONFIG_PATH="$LOCAL_INSTALL/lib/pkgconfig"
# Install Boost if Linux
- |-
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ "$CXX" == "g++" ]]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
pushd "$HOME"
wget 'http://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2'
tar jxf boost_1_60_0.tar.bz2
cd boost_1_60_0
export BOOST_HOME=`pwd`
./bootstrap.sh
./b2 --with-program_options --with-test --with-filesystem
cd "$LOCAL_INSTALL"
mkdir include && ln -s "$BOOST_HOME/boost" include/
mkdir lib && ln -s "$BOOST_HOME/stage/lib/"* lib/
export BOOST_PARAM="--with-boost=$LOCAL_INSTALL"
popd
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LOCAL_INSTALL/lib"
fi
# Install libgamecommon
- git clone http://github.com/Malvineous/libgamecommon.git
- pushd libgamecommon && ./autogen.sh && ./configure --prefix="$LOCAL_INSTALL" "$BOOST_PARAM" && make && make install && popd
before_script:
- ./autogen.sh
script:
- ./configure "$BOOST_PARAM" || cat config.log
- make && ulimit -c unlimited -S && make check
after_failure:
- |-
if [ -f tests/tests.log ]; then
cat tests/tests.log && sleep 5
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [ -f core ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./src/.libs/"
gdb ./tests/.libs/tests core -ex "thread apply all bt" -ex "set pagination 0" -batch
else
echo "No core dump; skipping gdb for backtrace"
fi
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# Make the build output lib dir located where dylib looks as default fallback,
# since setting DYLD_FALLBACK_LIBRARY_PATH doesn't seem to work
ln -s `pwd`"/src/.libs" "$HOME/lib"
# Run the tests with core dumps enabled
ulimit -c unlimited && ./tests/.libs/tests --no_catch_system_errors
# Look for a core dump and examine it if found
COREFILE=`ls -t /cores/* | head -n1`
if [ -f "$COREFILE" ]; then
echo "Found core dump: $COREFILE"
lldb -c "$COREFILE" --batch -o 'thread backtrace all' -o 'quit'
else
echo "No core dump; skipping lldb for backtrace"
fi
else
echo "Unknown OS, cannot check for core dump"
fi
fi
- echo == End of test log ==