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
|
2019-06-25 06:35:33 -07:00
|
|
|
"${CI_DIR}/common/submit_coverage.sh" "$@" || echo 'codecov upload failed.'
|
2018-02-06 19:20:45 -07:00
|
|
|
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 ======="
|
2020-11-16 19:26:47 -07:00
|
|
|
if test "${CI_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
|
2020-11-16 19:26:47 -07:00
|
|
|
if test "${CI_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
|
2021-04-02 21:15:51 -07:00
|
|
|
cores="$(find ./ -type f \( -name 'core.*' -o -name core -o -name nvim.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
|
2019-07-28 02:48:54 -07:00
|
|
|
rm "${log}"
|
2015-07-05 00:52:36 -07:00
|
|
|
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-*"
|
|
|
|
}
|
|
|
|
|
2019-08-14 09:27:08 -07:00
|
|
|
check_sanitizer() {
|
|
|
|
if test -n "${CLANG_SANITIZER}"; then
|
2020-08-27 19:50:38 -07:00
|
|
|
check_logs "${1}" "*san.*" | ${SYMBOLIZER:-cat}
|
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() {(
|
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
|
|
|
)}
|
2015-07-05 00:52:36 -07:00
|
|
|
|
2017-04-04 10:15:30 -07:00
|
|
|
run_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
|
2019-08-14 09:27:08 -07:00
|
|
|
check_sanitizer "${LOG_DIR}"
|
2015-07-05 00:52:36 -07:00
|
|
|
valgrind_check "${LOG_DIR}"
|
2016-11-01 05:51:07 -07:00
|
|
|
check_core_dumps
|
2017-04-04 10:15:30 -07:00
|
|
|
)}
|
2015-07-05 00:52:36 -07:00
|
|
|
|
2017-04-04 10:15:30 -07:00
|
|
|
run_oldtests() {(
|
2017-04-24 12:14:32 -07:00
|
|
|
ulimit -c unlimited || true
|
2019-08-28 13:47:54 -07:00
|
|
|
if ! make oldtest; 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
|
2019-08-14 09:27:08 -07:00
|
|
|
check_sanitizer "${LOG_DIR}"
|
2015-07-05 00:52:36 -07:00
|
|
|
valgrind_check "${LOG_DIR}"
|
2016-11-01 05:51:07 -07:00
|
|
|
check_core_dumps
|
2017-04-04 10:15:30 -07:00
|
|
|
)}
|
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() {(
|
|
|
|
if ! build_make install ; then
|
|
|
|
fail 'install' E 'make install failed'
|
2022-02-07 05:55:32 -07:00
|
|
|
exit_suite
|
2017-04-04 10:15:30 -07:00
|
|
|
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
|
|
|
)}
|