summaryrefslogtreecommitdiffstats
path: root/tests/test_in_vterm/test_vim.sh
blob: 2811e4564713ef030ec2bee1005bcd7823759436 (plain)
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
#!/bin/sh
. tests/shlib/common.sh
. tests/shlib/vterm.sh
. tests/shlib/vim.sh

enter_suite vvim final

vterm_setup

test_vim() {
	if test "$PYTHON_IMPLEMENTATION" != CPython ; then
		# Can only link with cpython
		return 0
	fi
	if ! command -v "$POWERLINE_VIM_EXE" ; then
		return 0
	fi
	ln -sf "$(command -v "${POWERLINE_VIM_EXE}")" "$TEST_ROOT/path/vim"
	f="$ROOT/tests/test_in_vterm/test_vim.py"
	if ! "${PYTHON}" "$f" ; then
		local test_name="$(LANG=C "$POWERLINE_VIM_EXE" --cmd 'echo version' --cmd qa 2>&1 | tail -n2)"
		fail "$test_name" F "Failed vterm test $f"
	fi
}

if test -z "$POWERLINE_VIM_EXE" && test -d "$ROOT/tests/bot-ci/deps/vim"
then
	for vim in "$OLD_VIM" "$NEW_VIM" ; do
		export POWERLINE_VIM_EXE="$vim"
		test_vim || true
	done
else
	export POWERLINE_VIM_EXE="${POWERLINE_VIM_EXE:-vim}"
	test_vim || true
fi

vterm_shutdown

exit_suite