aboutsummaryrefslogtreecommitdiff
path: root/ci/common/suite.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/common/suite.sh')
-rw-r--r--ci/common/suite.sh46
1 files changed, 8 insertions, 38 deletions
diff --git a/ci/common/suite.sh b/ci/common/suite.sh
index f6a8c22d21..5110e22ec2 100644
--- a/ci/common/suite.sh
+++ b/ci/common/suite.sh
@@ -11,49 +11,20 @@ FAIL_SUMMARY=""
END_MARKER="$BUILD_DIR/.tests_finished"
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
-ci_fold() {
- if test "$GITHUB_ACTIONS" = "true"; then
- local action="$1"
- local name="$2"
- case "$action" in
- start)
- echo "::group::${name}"
- ;;
- end)
- echo "::endgroup::"
- ;;
- *)
- :;;
- esac
- fi
-}
-
enter_suite() {
- set +x
FAILED=0
rm -f "${END_MARKER}"
local suite_name="$1"
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
- ci_fold "start" "$suite_name"
- set -x
}
exit_suite() {
- set +x
if test $FAILED -ne 0 ; then
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
echo "${FAIL_SUMMARY}"
- else
- ci_fold "end" ""
fi
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
- if test "$1" != "--continue" ; then
- exit $FAILED
- else
- local saved_failed=$FAILED
- FAILED=0
- return $saved_failed
- fi
+ FAILED=0
}
fail() {
@@ -71,16 +42,15 @@ fail() {
FAILED=1
}
-run_test() {
- local cmd="$1"
- local test_name="$2"
- eval "$cmd" || fail "$test_name"
-}
-
ended_successfully() {
if test -f "${FAIL_SUMMARY_FILE}" ; then
echo 'Test failed, complete summary:'
cat "${FAIL_SUMMARY_FILE}"
+
+ if [[ "$GITHUB_ACTIONS" == "true" ]]; then
+ rm -f "$FAIL_SUMMARY_FILE"
+ fi
+
return 1
fi
if ! test -f "${END_MARKER}" ; then
@@ -100,7 +70,7 @@ run_suite() {
local suite_name="$2"
enter_suite "$suite_name"
- run_test "$command" "$suite_name"
- exit_suite --continue
+ eval "$command" || fail "$suite_name"
+ exit_suite
}