forked from python-mode/python-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·58 lines (48 loc) · 1.57 KB
/
test.sh
File metadata and controls
executable file
·58 lines (48 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#! /bin/bash
# Check before starting.
set -e
which vim 1>/dev/null 2>/dev/null
cd "$(dirname "$0")"
# Source common variables.
source ./test_helpers_bash/test_variables.sh
# Prepare tests by cleaning up all files.
source ./test_helpers_bash/test_prepare_once.sh
# Initialize permanent files..
source ./test_helpers_bash/test_createvimrc.sh
# Execute tests.
declare -a TEST_ARRAY=(
"./test_bash/test_autopep8.sh"
"./test_bash/test_autocommands.sh"
"./test_bash/test_folding.sh"
"./test_bash/test_textobject.sh"
)
MAIN_RETURN=0
## now loop through the above array
set +e
for TEST in "${TEST_ARRAY[@]}"
do
echo "Starting test: ${TEST}" | tee -a "${VIM_OUTPUT_FILE}"
bash "${TEST}"
R=$?
MAIN_RETURN=$(( MAIN_RETURN + R ))
echo -e "${TEST}: Return code: ${R}\n" | tee -a "${VIM_OUTPUT_FILE}"
bash ./test_helpers_bash/test_prepare_between_tests.sh
done
echo "========================================================================="
echo " RESULTS"
echo "========================================================================="
# Show return codes.
RETURN_CODES=$(grep -i "Return code" < "${VIM_OUTPUT_FILE}" | grep -v "Return code: 0")
echo -e "${RETURN_CODES}"
# Show errors:
E1=$(grep -E "^E[0-9]+:" "${VIM_OUTPUT_FILE}")
E2=$(grep -Ei "^Error" "${VIM_OUTPUT_FILE}")
if [[ "${MAIN_RETURN}" == "0" ]]; then
echo "No errors."
else
echo "Errors:"
echo -e "${E1}\n${E2}"
fi
# Exit the script with error if there are any return codes different from 0.
exit ${MAIN_RETURN}
# vim: set fileformat=unix filetype=sh wrap tw=0 :