2017-03-31 06:02:53 -07:00
|
|
|
source "${CI_DIR}/common/build.sh"
|
2017-04-04 10:15:30 -07:00
|
|
|
source "${CI_DIR}/common/suite.sh"
|
2017-03-31 06:02:53 -07:00
|
|
|
|
2016-11-04 08:20:58 -07:00
|
|
|
print_core() {
|
|
|
|
local app="$1"
|
|
|
|
local core="$2"
|
|
|
|
if test "$app" = quiet ; then
|
|
|
|
echo "Found core $core"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
echo "======= Core file $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
|
|
|
|
}
|
|
|
|
|
2015-07-05 00:52:36 -07:00
|
|
|
check_core_dumps() {
|
2016-11-04 08:20:58 -07:00
|
|
|
local del=
|
|
|
|
if test "$1" = "--delete" ; then
|
|
|
|
del=1
|
|
|
|
shift
|
|
|
|
fi
|
2016-11-01 05:51:07 -07:00
|
|
|
local app="${1:-${BUILD_DIR}/bin/nvim}"
|
2015-07-05 00:52:36 -07:00
|
|
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
|
|
|
local cores="$(find /cores/ -type f -print)"
|
|
|
|
else
|
2016-11-04 08:20:58 -07:00
|
|
|
local cores="$(find ./ -type f -name 'core.*' -print)"
|
2015-07-05 00:52:36 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${cores}" ]; then
|
|
|
|
return
|
|
|
|
fi
|
2016-11-01 05:51:07 -07:00
|
|
|
local core
|
2015-07-05 00:52:36 -07:00
|
|
|
for core in $cores; do
|
2016-11-04 08:20:58 -07:00
|
|
|
if test "$del" = "1" ; then
|
|
|
|
print_core "$app" "$core" >&2
|
|
|
|
rm "$core"
|
2016-11-01 05:51:07 -07:00
|
|
|
else
|
2016-11-04 08:20:58 -07:00
|
|
|
print_core "$app" "$core"
|
2016-11-01 05:51:07 -07:00
|
|
|
fi
|
2015-07-05 00:52:36 -07:00
|
|
|
done
|
2017-04-04 10:15:30 -07:00
|
|
|
if test "$app" != quiet ; then
|
|
|
|
fail 'cores' E 'Core dumps found'
|
2016-11-04 08:20:58 -07:00
|
|
|
fi
|
2015-07-05 00:52:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
check_logs() {
|
|
|
|
# Iterate through each log to remove an useless warning.
|
|
|
|
for log in $(find "${1}" -type f -name "${2}"); do
|
|
|
|
sed -i "${log}" \
|
|
|
|
-e '/Warning: noted but unhandled ioctl/d' \
|
|
|
|
-e '/could cause spurious value errors to appear/d' \
|
|
|
|
-e '/See README_MISSING_SYSCALL_OR_IOCTL for guidance/d'
|
|
|
|
done
|
|
|
|
|
|
|
|
# Now do it again, but only consider files with size > 0.
|
|
|
|
local err=""
|
|
|
|
for log in $(find "${1}" -type f -name "${2}" -size +0); do
|
|
|
|
cat "${log}"
|
|
|
|
err=1
|
|
|
|
done
|
|
|
|
if [[ -n "${err}" ]]; then
|
2017-04-04 10:15:30 -07:00
|
|
|
fail 'logs' E 'Runtime errors detected.'
|
2015-07-05 00:52:36 -07:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
valgrind_check() {
|
|
|
|
check_logs "${1}" "valgrind-*"
|
|
|
|
}
|
|
|
|
|
|
|
|
asan_check() {
|
|
|
|
check_logs "${1}" "*san.*"
|
|
|
|
}
|
|
|
|
|
2017-04-04 10:15:30 -07:00
|
|
|
run_unittests() {(
|
|
|
|
enter_suite unittests
|
2016-11-01 05:51:07 -07:00
|
|
|
ulimit -c unlimited
|
2017-03-31 06:02:53 -07:00
|
|
|
if ! build_make unittest ; then
|
2017-04-04 10:15:30 -07:00
|
|
|
fail 'unittests' F 'Unit tests failed'
|
2016-11-01 05:51:07 -07:00
|
|
|
fi
|
|
|
|
check_core_dumps "$(which luajit)"
|
2017-04-04 10:15:30 -07:00
|
|
|
exit_suite
|
|
|
|
)}
|
2015-07-05 00:52:36 -07:00
|
|
|
|
2017-04-04 10:15:30 -07:00
|
|
|
run_functionaltests() {(
|
|
|
|
enter_suite functionaltests
|
2016-11-01 05:51:07 -07:00
|
|
|
ulimit -c unlimited
|
2017-03-31 06:02:53 -07:00
|
|
|
if ! build_make ${FUNCTIONALTEST}; then
|
2017-04-04 10:15:30 -07:00
|
|
|
fail 'functionaltests' F 'Functional tests failed'
|
2015-07-05 00:52:36 -07:00
|
|
|
fi
|
|
|
|
asan_check "${LOG_DIR}"
|
|
|
|
valgrind_check "${LOG_DIR}"
|
2016-11-01 05:51:07 -07:00
|
|
|
check_core_dumps
|
2017-04-04 10:15:30 -07:00
|
|
|
exit_suite
|
|
|
|
)}
|
2015-07-05 00:52:36 -07:00
|
|
|
|
2017-04-04 10:15:30 -07:00
|
|
|
run_oldtests() {(
|
|
|
|
enter_suite oldtests
|
2016-11-01 05:51:07 -07:00
|
|
|
ulimit -c unlimited
|
2017-02-13 07:07:49 -07:00
|
|
|
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
|
2015-07-05 00:52:36 -07:00
|
|
|
reset
|
2017-04-04 10:15:30 -07:00
|
|
|
fail 'oldtests' F 'Legacy tests failed'
|
2015-07-05 00:52:36 -07:00
|
|
|
fi
|
|
|
|
asan_check "${LOG_DIR}"
|
|
|
|
valgrind_check "${LOG_DIR}"
|
2016-11-01 05:51:07 -07:00
|
|
|
check_core_dumps
|
2017-04-04 10:15:30 -07:00
|
|
|
exit_suite
|
|
|
|
)}
|
2015-07-05 00:52:36 -07:00
|
|
|
|
2017-04-04 10:15:30 -07:00
|
|
|
install_nvim() {(
|
|
|
|
enter_suite 'install_nvim'
|
|
|
|
if ! build_make install ; then
|
|
|
|
fail 'install' E 'make install failed'
|
|
|
|
exit_suite
|
|
|
|
fi
|
2015-07-05 00:52:36 -07:00
|
|
|
|
|
|
|
"${INSTALL_PREFIX}/bin/nvim" --version
|
|
|
|
"${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' || {
|
|
|
|
echo "Running ':help' in the installed nvim failed."
|
|
|
|
echo "Maybe the helptags have not been generated properly."
|
2017-04-04 10:15:30 -07:00
|
|
|
fail 'help' F 'Failed running :help'
|
2015-07-05 00:52:36 -07:00
|
|
|
}
|
2015-08-11 21:44:34 -07:00
|
|
|
|
2016-07-13 15:42:55 -07:00
|
|
|
local genvimsynf=syntax/vim/generated.vim
|
2015-08-11 21:44:34 -07:00
|
|
|
# Check that all runtime files were installed
|
2016-07-13 15:42:55 -07:00
|
|
|
for file in doc/tags $genvimsynf $(
|
2015-08-16 06:43:52 -07:00
|
|
|
cd runtime ; git ls-files | grep -e '.vim$' -e '.ps$' -e '.dict$' -e '.py$' -e '.tutor$'
|
2015-08-11 21:44:34 -07:00
|
|
|
) ; do
|
|
|
|
if ! test -e "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then
|
2017-04-04 10:15:30 -07:00
|
|
|
fail 'runtime-install' F "It appears that $file is not installed."
|
2015-08-11 21:44:34 -07:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2016-07-13 15:42:55 -07:00
|
|
|
# Check that generated syntax file has function names, #5060.
|
|
|
|
local gpat='syn keyword vimFuncName .*eval'
|
2016-07-19 03:37:19 -07:00
|
|
|
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf"; then
|
2017-04-04 10:15:30 -07:00
|
|
|
fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
|
2016-07-13 15:42:55 -07:00
|
|
|
fi
|
|
|
|
|
2015-08-11 21:44:34 -07:00
|
|
|
for file in $(
|
|
|
|
cd runtime ; git ls-files | grep -e '.awk$' -e '.sh$' -e '.bat$'
|
|
|
|
) ; do
|
|
|
|
if ! test -x "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then
|
2017-04-04 10:15:30 -07:00
|
|
|
fail 'not-exe' F "It appears that $file is not installed or is not executable."
|
2015-08-11 21:44:34 -07:00
|
|
|
fi
|
|
|
|
done
|
2017-04-04 10:15:30 -07:00
|
|
|
exit_suite
|
|
|
|
)}
|