2017-04-24 12:14:32 -07:00
|
|
|
. "${CI_DIR}/common/build.sh"
|
|
|
|
. "${CI_DIR}/common/suite.sh"
|
2017-03-31 06:02:53 -07:00
|
|
|
|
2018-02-06 19:20:45 -07:00
|
|
|
submit_coverage() {
|
|
|
|
if [ -n "${GCOV}" ]; then
|
|
|
|
if curl --fail --output codecov.bash --silent https://codecov.io/bash; then
|
2019-06-15 09:34:00 -07:00
|
|
|
bash codecov.bash -c || echo "codecov upload failed."
|
2018-02-06 19:20:45 -07:00
|
|
|
rm -f codecov.bash
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
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 ======="
|
2017-04-24 13:11:13 -07:00
|
|
|
if test "${TRAVIS_OS_NAME}" = osx ; then
|
2016-11-04 08:20:58 -07:00
|
|
|
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}"
|
2019-06-11 08:03:03 -07:00
|
|
|
local cores
|
2017-04-24 13:11:13 -07:00
|
|
|
if test "${TRAVIS_OS_NAME}" = osx ; then
|
2019-06-11 08:03:03 -07:00
|
|
|
cores="$(find /cores/ -type f -print)"
|
2018-10-07 20:38:45 -07:00
|
|
|
local _sudo='sudo'
|
2015-07-05 00:52:36 -07:00
|
|
|
else
|
2019-06-11 08:03:03 -07:00
|
|
|
cores="$(find ./ -type f -name 'core.*' -print)"
|
2018-10-07 20:38:45 -07:00
|
|
|
local _sudo=
|
2015-07-05 00:52:36 -07:00
|
|
|
fi
|
|
|
|
|
2017-04-24 12:14:32 -07:00
|
|
|
if test -z "${cores}" ; then
|
2015-07-05 00:52:36 -07:00
|
|
|
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
|
2018-10-07 20:38:45 -07:00
|
|
|
"$_sudo" 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
|
2017-04-24 12:14:32 -07:00
|
|
|
if test -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() {
|
2018-01-01 19:46:44 -07:00
|
|
|
if test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
|
2018-11-20 18:22:42 -07:00
|
|
|
check_logs "${1}" "*san.*" | $ASAN_SYMBOLIZE
|
2018-01-01 19:46:44 -07:00
|
|
|
fi
|
2015-07-05 00:52:36 -07:00
|
|
|
}
|
|
|
|
|
2017-04-04 10:15:30 -07:00
|
|
|
run_unittests() {(
|
|
|
|
enter_suite unittests
|
2017-04-24 12:14:32 -07:00
|
|
|
ulimit -c unlimited || true
|
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
|
2018-02-06 19:20:45 -07:00
|
|
|
submit_coverage unittest
|
2019-06-11 08:03:03 -07:00
|
|
|
check_core_dumps "$(command -v 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
|
2017-04-24 12:14:32 -07:00
|
|
|
ulimit -c unlimited || true
|
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
|
2018-02-06 19:20:45 -07:00
|
|
|
submit_coverage functionaltest
|
2015-07-05 00:52:36 -07:00
|
|
|
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
|
2017-04-24 12:14:32 -07:00
|
|
|
ulimit -c unlimited || true
|
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
|
2018-02-06 19:20:45 -07:00
|
|
|
submit_coverage oldtest
|
2015-07-05 00:52:36 -07:00
|
|
|
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-24 12:14:32 -07:00
|
|
|
check_runtime_files() {(
|
2017-05-01 07:38:21 -07:00
|
|
|
set +x
|
2017-04-24 12:14:32 -07:00
|
|
|
local test_name="$1" ; shift
|
|
|
|
local message="$1" ; shift
|
|
|
|
local tst="$1" ; shift
|
|
|
|
|
|
|
|
cd runtime
|
|
|
|
for file in $(git ls-files "$@") ; do
|
|
|
|
# Check that test is not trying to work with files with spaces/etc
|
|
|
|
# Prefer failing the build over using more robust construct because files
|
|
|
|
# with IFS are not welcome.
|
|
|
|
if ! test -e "$file" ; then
|
|
|
|
fail "$test_name" E \
|
|
|
|
"It appears that $file is only a part of the file name"
|
|
|
|
fi
|
|
|
|
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
|
|
|
|
fail "$test_name" F "$(printf "$message" "$file")"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
)}
|
|
|
|
|
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
|
2017-04-24 12:14:32 -07:00
|
|
|
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
|
2015-07-05 00:52:36 -07:00
|
|
|
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'
|
2017-04-24 12:14:32 -07:00
|
|
|
fi
|
2015-08-11 21:44:34 -07:00
|
|
|
|
|
|
|
# Check that all runtime files were installed
|
2017-04-24 12:14:32 -07:00
|
|
|
check_runtime_files \
|
|
|
|
'runtime-install' \
|
|
|
|
'It appears that %s is not installed.' \
|
|
|
|
-e \
|
|
|
|
'*.vim' '*.ps' '*.dict' '*.py' '*.tutor'
|
|
|
|
|
|
|
|
# Check that some runtime files are installed and are executables
|
|
|
|
check_runtime_files \
|
|
|
|
'not-exe' \
|
|
|
|
'It appears that %s is not installed or is not executable.' \
|
|
|
|
-x \
|
|
|
|
'*.awk' '*.sh' '*.bat'
|
2015-08-11 21:44:34 -07:00
|
|
|
|
2016-07-13 15:42:55 -07:00
|
|
|
# Check that generated syntax file has function names, #5060.
|
2017-04-24 12:14:32 -07:00
|
|
|
local genvimsynf=syntax/vim/generated.vim
|
2016-07-13 15:42:55 -07:00
|
|
|
local gpat='syn keyword vimFuncName .*eval'
|
2017-04-24 12:14:32 -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
|
|
|
|
|
2017-04-04 10:15:30 -07:00
|
|
|
exit_suite
|
|
|
|
)}
|
2017-04-30 20:45:24 -07:00
|
|
|
|
|
|
|
csi_clean() {
|
|
|
|
find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete
|
|
|
|
find "${BUILD_DIR}" -name '*test-include*.o' -delete
|
|
|
|
}
|