2014-08-29 20:22:39 +02:00
|
|
|
#!/bin/sh
|
2015-08-22 16:18:35 +02:00
|
|
|
. tests/common.sh
|
|
|
|
|
|
|
|
enter_suite vim
|
2014-12-09 17:57:12 +01:00
|
|
|
|
|
|
|
if test -z "$VIM" ; then
|
2014-12-10 06:36:27 +01:00
|
|
|
if test -n "$USE_UCS2_PYTHON" ; then
|
2015-08-21 17:13:26 +02:00
|
|
|
NEW_VIM="$ROOT/tests/bot-ci/deps/vim/master-$UCS2_PYTHON_VARIANT-ucs2-double/vim"
|
|
|
|
OLD_VIM="$ROOT/tests/bot-ci/deps/vim/v7.0.112-$UCS2_PYTHON_VARIANT-ucs2/vim"
|
2015-05-10 18:40:47 +02:00
|
|
|
opt_dir="$HOME/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT"
|
2015-01-02 22:19:20 +01:00
|
|
|
main_path="$opt_dir/lib/python$UCS2_PYTHON_VARIANT"
|
|
|
|
site_path="$main_path/site-packages"
|
|
|
|
venv_main_path="$VIRTUAL_ENV/lib/python$UCS2_PYTHON_VARIANT"
|
|
|
|
venv_site_path="$venv_main_path/site-packages"
|
|
|
|
new_paths="${main_path}:${site_path}:${venv_main_path}:${venv_site_path}"
|
|
|
|
export PYTHONPATH="$new_paths${PYTHONPATH:+:}$PYTHONPATH"
|
2014-12-09 17:57:12 +01:00
|
|
|
else
|
2014-12-10 06:36:27 +01:00
|
|
|
if test "$PYTHON_IMPLEMENTATION" != "CPython" ; then
|
|
|
|
exit 0
|
|
|
|
fi
|
2015-02-20 20:39:50 +01:00
|
|
|
if test -d "$ROOT/tests/bot-ci/deps" ; then
|
2015-08-21 17:13:26 +02:00
|
|
|
NEW_VIM="$ROOT/tests/bot-ci/deps/vim/master-$PYTHON_MM/vim"
|
|
|
|
OLD_VIM="$ROOT/tests/bot-ci/deps/vim/v7.0.112-$PYTHON_MM/vim"
|
2015-02-20 20:39:50 +01:00
|
|
|
else
|
|
|
|
NEW_VIM="vim"
|
|
|
|
fi
|
2014-12-10 06:36:27 +01:00
|
|
|
if test -e "$OLD_VIM" ; then
|
|
|
|
VIMS="NEW_VIM OLD_VIM"
|
|
|
|
else
|
|
|
|
VIMS="NEW_VIM"
|
|
|
|
fi
|
2014-12-09 17:57:12 +01:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
NEW_VIM="$VIM"
|
|
|
|
OLD_VIM="$VIM"
|
|
|
|
fi
|
|
|
|
|
2015-01-07 14:24:48 +01:00
|
|
|
# Define some overrides. These ones must be ignored and do not affect Vim
|
|
|
|
# status/tab lines.
|
|
|
|
export POWERLINE_CONFIG_OVERRIDES='common.default_top_theme=ascii'
|
|
|
|
export POWERLINE_THEME_OVERRIDES='default.segments.left=[]'
|
|
|
|
|
2014-12-09 17:57:12 +01:00
|
|
|
test_script() {
|
|
|
|
local vim="$1"
|
|
|
|
local script="$2"
|
2015-08-22 16:18:35 +02:00
|
|
|
local test_name_prefix="$3"
|
2014-12-09 17:57:12 +01:00
|
|
|
echo "Running script $script with $vim"
|
2015-02-20 20:39:50 +01:00
|
|
|
if ! test -e "$vim" ; then
|
|
|
|
return 0
|
|
|
|
fi
|
2014-12-09 17:57:12 +01:00
|
|
|
if ! "$vim" -u NONE -S $script || test -f message.fail ; then
|
2015-08-22 16:18:35 +02:00
|
|
|
local test_name="$test_name_prefix-${script##*/}"
|
|
|
|
fail "${test_name%.vim}" F "Failed script $script run with $VIM"
|
2014-08-29 20:22:39 +02:00
|
|
|
cat message.fail >&2
|
|
|
|
rm message.fail
|
|
|
|
fi
|
2014-12-09 17:57:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for script in tests/test_*.vim ; do
|
|
|
|
if test "${script%.old.vim}" = "${script}" ; then
|
2015-08-22 16:18:35 +02:00
|
|
|
test_script "$NEW_VIM" "$script" new
|
2014-12-09 17:57:12 +01:00
|
|
|
fi
|
2014-08-29 20:22:39 +02:00
|
|
|
done
|
2014-12-09 17:57:12 +01:00
|
|
|
|
|
|
|
if test -e "$OLD_VIM" ; then
|
|
|
|
for script in tests/test_*.old.vim ; do
|
2015-08-22 16:18:35 +02:00
|
|
|
test_script "$OLD_VIM" "$script" old
|
2014-12-09 17:57:12 +01:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2015-08-22 16:18:35 +02:00
|
|
|
exit_suite
|