print core dumps on application crashes

This commit is contained in:
Konstantin Käfer
2014-10-23 03:30:05 -07:00
parent 10cb83579f
commit 3b397c56ed
3 changed files with 23 additions and 2 deletions

View File

@@ -33,6 +33,11 @@ before_install:
install:
- make config.gypi
- ./scripts/travis_install_test_suite.sh
- ulimit -c
before_script:
# Set the core file limit to unlimited so a core file is generated upon crash
- ulimit -c unlimited -S
script:
- ./scripts/travis_script.sh

View File

@@ -3,8 +3,24 @@
set -e
set -o pipefail
# allow writing core files
ulimit -c unlimited -S
cd build/${BUILDTYPE:-Release}
for TEST in ./test_* ; do
${TEST}
RESULT=0
${TEST} || RESULT=$?
# output core dump if we got one
for DUMP in $(find ./ -maxdepth 1 -name 'core*' -print); do
gdb ${TEST} ${DUMP} -ex "thread apply all bt" -ex "set pagination 0" -batch
rm -rf ${DUMP}
done
# now we should present travis with the original
# error code so the run cleanly stops
if [[ ${RESULT} != 0 ]]; then
exit $RESULT
fi
done

View File

@@ -19,7 +19,7 @@ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
sudo apt-get -y install gcc-4.8 g++-4.8
mapbox_time "install_build_tools" \
sudo apt-get -y install git build-essential zlib1g-dev automake \
sudo apt-get -y install git build-essential zlib1g-dev automake gdb \
libtool xutils-dev make cmake pkg-config python-pip \
libboost1.55-dev libboost-regex1.55-dev libcurl4-openssl-dev \
libpng-dev libsqlite3-dev