summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml5
-rwxr-xr-xscripts/run_tests.sh18
-rwxr-xr-xscripts/travis_before_install.sh2
3 files changed, 23 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index bc714f77c6..653b61037e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -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
diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh
index dd9ee3f260..e9952e46be 100755
--- a/scripts/run_tests.sh
+++ b/scripts/run_tests.sh
@@ -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
diff --git a/scripts/travis_before_install.sh b/scripts/travis_before_install.sh
index 1ecfc4f26b..fefd6937f2 100755
--- a/scripts/travis_before_install.sh
+++ b/scripts/travis_before_install.sh
@@ -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