Files
neovim/ci/run_tests.sh
dundargoc c1d76363ac ci: simplify how environment variables are used (#22067)
Having a clear separation between when we manipulate variables and when
we export them to GITHUB_ENV makes it less error-prone.
2023-02-07 14:43:45 +01:00

69 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source-path=SCRIPTDIR
source "${CI_DIR}/common/test.sh"
# shellcheck source-path=SCRIPTDIR
source "${CI_DIR}/common/suite.sh"
build_nvim() {
check_core_dumps --delete quiet
if test -n "${CLANG_SANITIZER}" ; then
CMAKE_FLAGS="${CMAKE_FLAGS} -D CLANG_${CLANG_SANITIZER}=ON"
fi
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"
echo "Configuring with '${CMAKE_FLAGS} $*'."
# shellcheck disable=SC2086
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}"
echo "Building nvim."
ninja nvim || exit 1
# Invoke nvim to trigger *San early.
if ! (bin/nvim --version && bin/nvim -u NONE -e -cq | cat -vet) ; then
check_sanitizer "${LOG_DIR}"
exit 1
fi
check_sanitizer "${LOG_DIR}"
cd "${CI_BUILD_DIR}"
}
rm -f "$END_MARKER"
# Run all tests (with some caveats) if no input argument is given
if (($# == 0)); then
tests=('build_nvim')
# Additional threads aren't created in the unit/old tests
if test "$CLANG_SANITIZER" != "TSAN"; then
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
tests+=('unittests')
fi
tests+=('oldtests')
fi
tests+=('functionaltests' 'install_nvim')
else
tests=("$@")
fi
for i in "${tests[@]}"; do
eval "$i" || fail "$i"
done
touch "${END_MARKER}"
ended_successfully
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
echo '=== Unexpected gcov errors: ==='
cat "${GCOV_ERROR_FILE}"
exit 1
fi