All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
6 docker_flags=(--rm -v "$PWD:/testplugin" -v "$PWD/test:/home" -w /testplugin "$DOCKER_RUN_IMAGE")
13 while [ $# -ne 0 ]; do
28 echo "Invalid argument: $1" 1>&2
43 # Neovim 0.6+ requires headless argument to load Vader tests.
52 # This file will be used to track if tests ran or not.
53 # We can't use a variable, because we need to set a value in a sub-shell.
54 run_file="$(mktemp -t tests_ran.XXXXXXXX)"
56 function filter-vader-output() {
57 local hit_first_vader_line=0
58 # When verbose mode is off, suppress output until Vader starts.
59 local start_output="$verbose"
60 local filtered_data=''
63 # Search for the first Vader output line.
64 # We can try starting tests again if they don't start.
65 if ((!hit_first_vader_line)); then
66 if [[ "$REPLY" = *'Starting Vader:'* ]]; then
67 hit_first_vader_line=1
71 if ((!start_output)); then
72 if ((hit_first_vader_line)); then
80 if [[ "$REPLY" = *'Starting Vader:'* ]]; then
81 filtered_data="$REPLY"
82 elif [[ "$REPLY" = *'Success/Total'* ]]; then
83 success="$(echo -n "$REPLY" | grep -o '[0-9]\+/' | head -n1 | cut -d/ -f1)"
84 total="$(echo -n "$REPLY" | grep -o '/[0-9]\+' | head -n1 | cut -d/ -f2)"
86 if [ "$success" -lt "$total" ]; then
93 filtered_data="$filtered_data"$'\n'"$REPLY"
100 # Note that we managed to get the Vader tests started if we did.
101 if ((hit_first_vader_line)); then
106 function color-vader-output() {
108 if [[ "$REPLY" = *'[EXECUTE] (X)'* ]]; then
110 elif [[ "$REPLY" = *'[EXECUTE]'* ]] || [[ "$REPLY" = *'[ GIVEN]'* ]]; then
114 if [[ "$REPLY" = *'Success/Total'* ]]; then
115 success="$(echo -n "$REPLY" | grep -o '[0-9]\+/' | head -n1 | cut -d/ -f1)"
116 total="$(echo -n "$REPLY" | grep -o '/[0-9]\+' | head -n1 | cut -d/ -f2)"
118 if [ "$success" -lt "$total" ]; then
135 echo '========================================'
136 echo "Running tests for $vim"
137 echo '========================================'
142 while [ "$tries" -lt 5 ]; do
147 # shellcheck disable=SC2086
148 "$DOCKER" run -a stderr -e VADER_OUTPUT_FILE=/dev/stderr "${docker_flags[@]}" \
149 "/vim-build/bin/$vim" -u test/vimrc ${headless} \
150 "+Vader! $tests" 2>&1 | filter-vader-output | color-vader-output || exit_code=$?
153 if [ -s "$run_file" ]; then
158 if [ "$tries" -gt 1 ]; then
160 echo "Tried to run tests $tries times"