travis: Force travis build to fail when core files are dumped

This commit is contained in:
Thiago de Arruda
2014-11-03 10:52:04 -03:00
parent eeaac9f639
commit b320904382
3 changed files with 14 additions and 6 deletions

View File

@@ -7,10 +7,7 @@ asan_check() {
}
check_logs() {
# For some strange reason, now we need to give ubuntu some time to flush it's
# FS cache in order to see error logs, even though all commands are executing
# synchronously
sleep 1
check_core_dumps
# Iterate through each log to remove an useless warning
for log in $(find "$1" -type f -name "$2"); do
sed -i "$log" \
@@ -29,6 +26,15 @@ check_logs() {
fi
}
check_core_dumps() {
sleep 2
local c
for c in $(find ./ -name '*core*' -print); do
gdb -q -n -batch -ex bt build/bin/nvim $c
exit 1
done
}
set_environment() {
local prefix="$1/usr"
eval $($prefix/bin/luarocks path)

View File

@@ -23,4 +23,6 @@ CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON \
$MAKE_CMD CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" unittest
$MAKE_CMD test
check_core_dumps
$MAKE_CMD oldtest
check_core_dumps

View File

@@ -20,9 +20,9 @@ before_install:
# Need xvfb for running some tests with xclip
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sudo apt-get install xclip
- sudo apt-get install xclip gdb
script:
# This will pass the environment variables down to a bash process which runs
# as $USER, while retaining the environment variables defined and belonging
# to secondary groups given above in usermod.
- sudo -E su ${USER} -c "sh -e \"${CI_SCRIPTS}/${CI_TARGET}.sh\""
- sudo -E su ${USER} -c "ulimit -c 102400; sh -e \"${CI_SCRIPTS}/${CI_TARGET}.sh\""