1
mirror of https://github.com/neovim/neovim.git synced 2025-01-02 17:33:28 -07:00

ci: Try checking for core dumps

Note: can’t use `dbg_cmd` string because I need arguments with spaces (i.e. `bt
all` and `thread apply all bt full`).
This commit is contained in:
ZyX 2016-11-01 15:51:07 +03:00
parent da2139296d
commit 3e94510570

View File

@ -1,20 +1,22 @@
check_core_dumps() { check_core_dumps() {
sleep 2 local app="${1:-${BUILD_DIR}/bin/nvim}"
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
local cores="$(find /cores/ -type f -print)" local cores="$(find /cores/ -type f -print)"
local dbg_cmd="lldb -Q -o bt -f ${BUILD_DIR}/bin/nvim -c"
else else
# FIXME (fwalch): Will trigger if a file named core.* exists outside of $DEPS_BUILD_DIR. # FIXME (fwalch): Will trigger if a file named core.* exists outside of $DEPS_BUILD_DIR.
local cores="$(find ./ -type f -not -path "*${DEPS_BUILD_DIR}*" -name 'core.*' -print)" local cores="$(find ./ -type f -not -path "*${DEPS_BUILD_DIR}*" -name 'core.*' -print)"
local dbg_cmd="gdb -n -batch -ex bt ${BUILD_DIR}/bin/nvim"
fi fi
if [ -z "${cores}" ]; then if [ -z "${cores}" ]; then
return return
fi fi
local core
for core in $cores; do for core in $cores; do
${dbg_cmd} "${core}" if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
lldb -Q -o "bt all" -f "${app}" -c "${core}"
else
gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}"
fi
done done
exit 1 exit 1
} }
@ -49,28 +51,39 @@ asan_check() {
} }
run_unittests() { run_unittests() {
${MAKE_CMD} -C "${BUILD_DIR}" unittest ulimit -c unlimited
if ! ${MAKE_CMD} -C "${BUILD_DIR}" unittest ; then
check_core_dumps "$(which luajit)"
exit 1
fi
check_core_dumps "$(which luajit)"
} }
run_functionaltests() { run_functionaltests() {
ulimit -c unlimited
if ! ${MAKE_CMD} -C "${BUILD_DIR}" ${FUNCTIONALTEST}; then if ! ${MAKE_CMD} -C "${BUILD_DIR}" ${FUNCTIONALTEST}; then
asan_check "${LOG_DIR}" asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}" valgrind_check "${LOG_DIR}"
check_core_dumps
exit 1 exit 1
fi fi
asan_check "${LOG_DIR}" asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}" valgrind_check "${LOG_DIR}"
check_core_dumps
} }
run_oldtests() { run_oldtests() {
ulimit -c unlimited
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
reset reset
asan_check "${LOG_DIR}" asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}" valgrind_check "${LOG_DIR}"
check_core_dumps
exit 1 exit 1
fi fi
asan_check "${LOG_DIR}" asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}" valgrind_check "${LOG_DIR}"
check_core_dumps
} }
install_nvim() { install_nvim() {