mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #6581 from ZyX-I/really-kill-single-includes
ci: When using restarting tests kill make with the shell
This commit is contained in:
commit
e4dcf756ae
@ -7,10 +7,10 @@ build_make() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_deps() {
|
build_deps() {
|
||||||
if [[ "${BUILD_32BIT}" == ON ]]; then
|
if test "${BUILD_32BIT}" = ON ; then
|
||||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||||
fi
|
fi
|
||||||
if [[ "${FUNCTIONALTEST}" == "functionaltest-lua" ]]; then
|
if test "${FUNCTIONALTEST}" = "functionaltest-lua" ; then
|
||||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -18,16 +18,15 @@ build_deps() {
|
|||||||
|
|
||||||
# If there is a valid cache and we're not forced to recompile,
|
# If there is a valid cache and we're not forced to recompile,
|
||||||
# use cached third-party dependencies.
|
# use cached third-party dependencies.
|
||||||
if [[ -f "${CACHE_MARKER}" ]] && [[ "${BUILD_NVIM_DEPS}" != true ]]; then
|
if test -f "${CACHE_MARKER}" && test "${BUILD_NVIM_DEPS}" != "true" ; then
|
||||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
local statcmd="stat -c '%y'"
|
||||||
local statcmd="stat -f '%Sm'"
|
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||||
else
|
statcmd="stat -f '%Sm'"
|
||||||
local statcmd="stat -c '%y'"
|
|
||||||
fi
|
fi
|
||||||
echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))."
|
echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))."
|
||||||
|
|
||||||
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
|
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
|
||||||
mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
|
mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
|
||||||
else
|
else
|
||||||
mkdir -p "${DEPS_BUILD_DIR}"
|
mkdir -p "${DEPS_BUILD_DIR}"
|
||||||
fi
|
fi
|
||||||
@ -46,10 +45,10 @@ build_deps() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prepare_build() {
|
prepare_build() {
|
||||||
if [[ -n "${CLANG_SANITIZER}" ]]; then
|
if test -n "${CLANG_SANITIZER}" ; then
|
||||||
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
||||||
fi
|
fi
|
||||||
if [[ "${BUILD_32BIT}" == ON ]]; then
|
if test "${BUILD_32BIT}" = ON ; then
|
||||||
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -61,24 +60,24 @@ prepare_build() {
|
|||||||
|
|
||||||
build_nvim() {
|
build_nvim() {
|
||||||
echo "Building nvim."
|
echo "Building nvim."
|
||||||
if ! top_make nvim; then
|
if ! top_make nvim ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CLANG_SANITIZER" != "TSAN" ]; then
|
if test "$CLANG_SANITIZER" != "TSAN" ; then
|
||||||
echo "Building libnvim."
|
echo "Building libnvim."
|
||||||
if ! top_make libnvim; then
|
if ! top_make libnvim ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Building nvim-test."
|
echo "Building nvim-test."
|
||||||
if ! top_make nvim-test; then
|
if ! top_make nvim-test ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Invoke nvim to trigger *San early.
|
# Invoke nvim to trigger *San early.
|
||||||
if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall'); then
|
if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall') ; then
|
||||||
asan_check "${LOG_DIR}"
|
asan_check "${LOG_DIR}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -24,7 +24,7 @@ exit_suite() {
|
|||||||
echo "${FAIL_SUMMARY}"
|
echo "${FAIL_SUMMARY}"
|
||||||
fi
|
fi
|
||||||
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
|
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
|
||||||
if test "x$1" != "x--continue" ; then
|
if test "$1" != "--continue" ; then
|
||||||
exit $FAILED
|
exit $FAILED
|
||||||
else
|
else
|
||||||
local saved_failed=$FAILED
|
local saved_failed=$FAILED
|
||||||
@ -61,7 +61,7 @@ run_test() {
|
|||||||
|
|
||||||
run_test_wd() {
|
run_test_wd() {
|
||||||
local hang_ok=
|
local hang_ok=
|
||||||
if test "x$1" = "x--allow-hang" ; then
|
if test "$1" = "--allow-hang" ; then
|
||||||
hang_ok=1
|
hang_ok=1
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
@ -82,21 +82,31 @@ run_test_wd() {
|
|||||||
|
|
||||||
local output_file="$(mktemp)"
|
local output_file="$(mktemp)"
|
||||||
local status_file="$(mktemp)"
|
local status_file="$(mktemp)"
|
||||||
|
local sid_file="$(mktemp)"
|
||||||
|
|
||||||
local restarts=5
|
local restarts=5
|
||||||
local prev_tmpsize=-1
|
local prev_tmpsize=-1
|
||||||
while test $restarts -gt 0 ; do
|
while test $restarts -gt 0 ; do
|
||||||
: > "${status_file}"
|
: > "$status_file"
|
||||||
(
|
: > "$sid_file"
|
||||||
set -o pipefail
|
setsid \
|
||||||
ret=0
|
env \
|
||||||
if ! eval "$cmd" 2>&1 | tee -a "$output_file" ; then
|
output_file="$output_file" \
|
||||||
ret=1
|
status_file="$status_file" \
|
||||||
fi
|
sid_file="$sid_file" \
|
||||||
echo "$ret" > "$status_file"
|
cmd="$cmd" \
|
||||||
exit $ret
|
CI_DIR="$CI_DIR" \
|
||||||
) &
|
sh -c '
|
||||||
local pid=$!
|
. "${CI_DIR}/common/test.sh"
|
||||||
|
ps -o sid= > "$sid_file"
|
||||||
|
(
|
||||||
|
ret=0
|
||||||
|
if ! eval "$cmd" 2>&1 ; then
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
echo "$ret" > "$status_file"
|
||||||
|
) | tee -a "$output_file"
|
||||||
|
'
|
||||||
while test "$(stat -c "%s" "$status_file")" -eq 0 ; do
|
while test "$(stat -c "%s" "$status_file")" -eq 0 ; do
|
||||||
prev_tmpsize=$tmpsize
|
prev_tmpsize=$tmpsize
|
||||||
sleep $timeout
|
sleep $timeout
|
||||||
@ -106,13 +116,23 @@ run_test_wd() {
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
restarts=$[ restarts - 1 ]
|
restarts=$(( restarts - 1 ))
|
||||||
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
|
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
|
||||||
# status file not updated, assuming hang
|
# Status file not updated, assuming hang
|
||||||
kill -KILL $pid
|
|
||||||
|
# SID not known, this should not ever happen
|
||||||
|
if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then
|
||||||
|
fail "$test_name" E "Shell did not run"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Kill all processes which belong to one session: should get rid of test
|
||||||
|
# processes as well as sh itself.
|
||||||
|
pkill -KILL -s$(cat "$sid_file")
|
||||||
|
|
||||||
if test $restarts -eq 0 ; then
|
if test $restarts -eq 0 ; then
|
||||||
if test "x$hang_ok" = "x" ; then
|
if test -z "$hang_ok" ; then
|
||||||
fail "${test_name}" E "Test hang up"
|
fail "$test_name" E "Test hang up"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Test ${test_name} hang up, restarting"
|
echo "Test ${test_name} hang up, restarting"
|
||||||
@ -120,21 +140,25 @@ run_test_wd() {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
local new_failed="$(cat "$status_file")"
|
local new_failed="$(cat "$status_file")"
|
||||||
if test "x$new_failed" != "x0" ; then
|
if test "$new_failed" != "0" ; then
|
||||||
fail "${test_name}" F "Test failed in run_test_wd"
|
fail "$test_name" F "Test failed in run_test_wd"
|
||||||
fi
|
fi
|
||||||
return 0
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
rm -f "$output_file"
|
||||||
|
rm -f "$status_file"
|
||||||
|
rm -f "$sid_file"
|
||||||
}
|
}
|
||||||
|
|
||||||
ended_successfully() {
|
ended_successfully() {
|
||||||
if [[ -f "${FAIL_SUMMARY_FILE}" ]]; then
|
if test -f "${FAIL_SUMMARY_FILE}" ; then
|
||||||
echo 'Test failed, complete summary:'
|
echo 'Test failed, complete summary:'
|
||||||
cat "${FAIL_SUMMARY_FILE}"
|
cat "${FAIL_SUMMARY_FILE}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if ! [[ -f "${END_MARKER}" ]] ; then
|
if ! test -f "${END_MARKER}" ; then
|
||||||
echo 'ended_successfully called before end marker was touched'
|
echo 'ended_successfully called before end marker was touched'
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
source "${CI_DIR}/common/build.sh"
|
. "${CI_DIR}/common/build.sh"
|
||||||
source "${CI_DIR}/common/suite.sh"
|
. "${CI_DIR}/common/suite.sh"
|
||||||
|
|
||||||
print_core() {
|
print_core() {
|
||||||
local app="$1"
|
local app="$1"
|
||||||
@ -9,7 +9,7 @@ print_core() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
echo "======= Core file $core ======="
|
echo "======= Core file $core ======="
|
||||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||||
lldb -Q -o "bt all" -f "${app}" -c "${core}"
|
lldb -Q -o "bt all" -f "${app}" -c "${core}"
|
||||||
else
|
else
|
||||||
gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}"
|
gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}"
|
||||||
@ -23,13 +23,13 @@ check_core_dumps() {
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
local app="${1:-${BUILD_DIR}/bin/nvim}"
|
local app="${1:-${BUILD_DIR}/bin/nvim}"
|
||||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||||
local cores="$(find /cores/ -type f -print)"
|
local cores="$(find /cores/ -type f -print)"
|
||||||
else
|
else
|
||||||
local cores="$(find ./ -type f -name 'core.*' -print)"
|
local cores="$(find ./ -type f -name 'core.*' -print)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${cores}" ]; then
|
if test -z "${cores}" ; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
local core
|
local core
|
||||||
@ -61,7 +61,7 @@ check_logs() {
|
|||||||
cat "${log}"
|
cat "${log}"
|
||||||
err=1
|
err=1
|
||||||
done
|
done
|
||||||
if [[ -n "${err}" ]]; then
|
if test -n "${err}" ; then
|
||||||
fail 'logs' E 'Runtime errors detected.'
|
fail 'logs' E 'Runtime errors detected.'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ asan_check() {
|
|||||||
|
|
||||||
run_unittests() {(
|
run_unittests() {(
|
||||||
enter_suite unittests
|
enter_suite unittests
|
||||||
ulimit -c unlimited
|
ulimit -c unlimited || true
|
||||||
if ! build_make unittest ; then
|
if ! build_make unittest ; then
|
||||||
fail 'unittests' F 'Unit tests failed'
|
fail 'unittests' F 'Unit tests failed'
|
||||||
fi
|
fi
|
||||||
@ -86,7 +86,7 @@ run_unittests() {(
|
|||||||
|
|
||||||
run_functionaltests() {(
|
run_functionaltests() {(
|
||||||
enter_suite functionaltests
|
enter_suite functionaltests
|
||||||
ulimit -c unlimited
|
ulimit -c unlimited || true
|
||||||
if ! build_make ${FUNCTIONALTEST}; then
|
if ! build_make ${FUNCTIONALTEST}; then
|
||||||
fail 'functionaltests' F 'Functional tests failed'
|
fail 'functionaltests' F 'Functional tests failed'
|
||||||
fi
|
fi
|
||||||
@ -98,7 +98,7 @@ run_functionaltests() {(
|
|||||||
|
|
||||||
run_oldtests() {(
|
run_oldtests() {(
|
||||||
enter_suite oldtests
|
enter_suite oldtests
|
||||||
ulimit -c unlimited
|
ulimit -c unlimited || true
|
||||||
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
|
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
|
||||||
reset
|
reset
|
||||||
fail 'oldtests' F 'Legacy tests failed'
|
fail 'oldtests' F 'Legacy tests failed'
|
||||||
@ -109,6 +109,26 @@ run_oldtests() {(
|
|||||||
exit_suite
|
exit_suite
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
check_runtime_files() {(
|
||||||
|
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
|
||||||
|
)}
|
||||||
|
|
||||||
install_nvim() {(
|
install_nvim() {(
|
||||||
enter_suite 'install_nvim'
|
enter_suite 'install_nvim'
|
||||||
if ! build_make install ; then
|
if ! build_make install ; then
|
||||||
@ -117,34 +137,32 @@ install_nvim() {(
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
"${INSTALL_PREFIX}/bin/nvim" --version
|
"${INSTALL_PREFIX}/bin/nvim" --version
|
||||||
"${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' || {
|
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
|
||||||
echo "Running ':help' in the installed nvim failed."
|
echo "Running ':help' in the installed nvim failed."
|
||||||
echo "Maybe the helptags have not been generated properly."
|
echo "Maybe the helptags have not been generated properly."
|
||||||
fail 'help' F 'Failed running :help'
|
fail 'help' F 'Failed running :help'
|
||||||
}
|
fi
|
||||||
|
|
||||||
local genvimsynf=syntax/vim/generated.vim
|
|
||||||
# Check that all runtime files were installed
|
# Check that all runtime files were installed
|
||||||
for file in doc/tags $genvimsynf $(
|
check_runtime_files \
|
||||||
cd runtime ; git ls-files | grep -e '.vim$' -e '.ps$' -e '.dict$' -e '.py$' -e '.tutor$'
|
'runtime-install' \
|
||||||
) ; do
|
'It appears that %s is not installed.' \
|
||||||
if ! test -e "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then
|
-e \
|
||||||
fail 'runtime-install' F "It appears that $file is not installed."
|
'*.vim' '*.ps' '*.dict' '*.py' '*.tutor'
|
||||||
fi
|
|
||||||
done
|
# 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'
|
||||||
|
|
||||||
# Check that generated syntax file has function names, #5060.
|
# Check that generated syntax file has function names, #5060.
|
||||||
|
local genvimsynf=syntax/vim/generated.vim
|
||||||
local gpat='syn keyword vimFuncName .*eval'
|
local gpat='syn keyword vimFuncName .*eval'
|
||||||
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf"; then
|
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
|
||||||
fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
|
fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
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
|
|
||||||
fail 'not-exe' F "It appears that $file is not installed or is not executable."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
exit_suite
|
exit_suite
|
||||||
)}
|
)}
|
||||||
|
Loading…
Reference in New Issue
Block a user