rearrange tests and make more robust
This commit is contained in:
@@ -3,34 +3,34 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
for TEST in build/${BUILDTYPE:-Release}/test* ; do
|
||||
# allow writing core files
|
||||
ulimit -c unlimited -S
|
||||
echo 'ulimit -c: '`ulimit -c`
|
||||
if [ -f /proc/sys/kernel/core_pattern ]; then
|
||||
echo '/proc/sys/kernel/core_pattern: '`cat /proc/sys/kernel/core_pattern`
|
||||
fi
|
||||
CMD="build/${BUILDTYPE:-Release}/test"
|
||||
|
||||
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
|
||||
sysctl kernel.core_pattern
|
||||
fi
|
||||
# allow writing core files
|
||||
ulimit -c unlimited -S
|
||||
echo 'ulimit -c: '`ulimit -c`
|
||||
if [ -f /proc/sys/kernel/core_pattern ]; then
|
||||
echo '/proc/sys/kernel/core_pattern: '`cat /proc/sys/kernel/core_pattern`
|
||||
fi
|
||||
|
||||
RESULT=0
|
||||
${TEST} || RESULT=$?
|
||||
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
|
||||
sysctl kernel.core_pattern
|
||||
fi
|
||||
|
||||
if [[ ${RESULT} != 0 ]]; then
|
||||
echo "The program crashed with exit code ${RESULT}. We're now trying to output the core dump."
|
||||
fi
|
||||
RESULT=0
|
||||
${CMD} "$@" || 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
|
||||
if [[ ${RESULT} != 0 ]]; then
|
||||
echo "The program crashed with exit code ${RESULT}. We're now trying to output the core dump."
|
||||
fi
|
||||
|
||||
# now we should present travis with the original
|
||||
# error code so the run cleanly stops
|
||||
if [[ ${RESULT} != 0 ]]; then
|
||||
exit $RESULT
|
||||
fi
|
||||
# output core dump if we got one
|
||||
for DUMP in $(find ./ -maxdepth 1 -name 'core*' -print); do
|
||||
gdb ${CMD} ${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
|
||||
|
||||
Reference in New Issue
Block a user