2014-08-29 20:22:39 +02:00
|
|
|
#!/bin/sh
|
2014-12-09 17:20:46 +01:00
|
|
|
. tests/bot-ci/scripts/common/main.sh
|
2014-08-29 20:22:39 +02:00
|
|
|
FAILED=0
|
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-01-02 22:19:20 +01:00
|
|
|
NEW_VIM="$ROOT/tests/bot-ci/deps/vim/tip-$UCS2_PYTHON_VARIANT-double/vim"
|
|
|
|
opt_dir="/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT"
|
|
|
|
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-01-02 22:19:20 +01:00
|
|
|
NEW_VIM="$ROOT/tests/bot-ci/deps/vim/tip-$PYTHON_VERSION/vim"
|
|
|
|
OLD_VIM="$ROOT/tests/bot-ci/deps/vim/v7-0-112-$PYTHON_VERSION/vim"
|
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
|
|
|
|
|
|
|
|
test_script() {
|
|
|
|
local vim="$1"
|
|
|
|
local script="$2"
|
|
|
|
echo "Running script $script with $vim"
|
|
|
|
if ! "$vim" -u NONE -S $script || test -f message.fail ; then
|
2014-12-09 17:20:46 +01:00
|
|
|
echo "Failed script $script run with $VIM" >&2
|
2014-08-29 20:22:39 +02:00
|
|
|
cat message.fail >&2
|
|
|
|
rm message.fail
|
|
|
|
FAILED=1
|
|
|
|
fi
|
2014-12-09 17:57:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for script in tests/test_*.vim ; do
|
|
|
|
if test "${script%.old.vim}" = "${script}" ; then
|
|
|
|
test_script "$NEW_VIM" "$script"
|
|
|
|
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
|
|
|
|
test_script "$OLD_VIM" "$script"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2014-08-29 20:22:39 +02:00
|
|
|
exit $FAILED
|