2015-01-11 01:09:14 +01:00
|
|
|
#!/bin/sh
|
2015-08-22 16:18:35 +02:00
|
|
|
. tests/common.sh
|
2015-01-11 01:09:14 +01:00
|
|
|
|
2015-08-22 16:18:35 +02:00
|
|
|
enter_suite tmux
|
2015-01-11 01:09:14 +01:00
|
|
|
|
2015-08-21 17:39:52 +02:00
|
|
|
rm -rf tests/vterm_tmux
|
|
|
|
mkdir tests/vterm_tmux
|
|
|
|
mkdir tests/vterm_tmux/path
|
2015-01-11 01:09:14 +01:00
|
|
|
|
2015-08-21 17:39:52 +02:00
|
|
|
ln -s "$(which "${PYTHON}")" tests/vterm_tmux/path/python
|
|
|
|
ln -s "$(which bash)" tests/vterm_tmux/path
|
|
|
|
ln -s "$(which env)" tests/vterm_tmux/path
|
|
|
|
ln -s "$(which cut)" tests/vterm_tmux/path
|
|
|
|
ln -s "$PWD/scripts/powerline-render" tests/vterm_tmux/path
|
|
|
|
ln -s "$PWD/scripts/powerline-config" tests/vterm_tmux/path
|
2015-01-11 01:09:14 +01:00
|
|
|
|
2015-08-21 17:39:52 +02:00
|
|
|
cp -r tests/terminfo tests/vterm_tmux
|
2015-01-18 02:43:46 +01:00
|
|
|
|
2015-01-11 01:09:14 +01:00
|
|
|
test_tmux() {
|
2015-02-21 13:09:41 +01:00
|
|
|
if test "$PYTHON_IMPLEMENTATION" = PyPy; then
|
|
|
|
# FIXME PyPy3 segfaults for some reason, PyPy does it as well, but
|
|
|
|
# occasionally.
|
2015-01-16 22:25:46 +01:00
|
|
|
return 0
|
|
|
|
fi
|
2015-01-11 01:09:14 +01:00
|
|
|
if ! which "${POWERLINE_TMUX_EXE}" ; then
|
|
|
|
return 0
|
|
|
|
fi
|
2015-08-21 17:39:52 +02:00
|
|
|
ln -sf "$(which "${POWERLINE_TMUX_EXE}")" tests/vterm_tmux/path
|
2015-01-18 00:47:38 +01:00
|
|
|
f=tests/test_in_vterm/test_tmux.py
|
|
|
|
if ! "${PYTHON}" $f ; then
|
2015-08-22 16:18:35 +02:00
|
|
|
local test_name="$("$POWERLINE_TMUX_EXE" -V 2>&1 | cut -d' ' -f2)"
|
|
|
|
fail "$test_name" F "Failed vterm test $f"
|
2015-01-11 01:09:14 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2015-01-18 00:47:38 +01:00
|
|
|
if test -z "$POWERLINE_TMUX_EXE" && test -d tests/bot-ci/deps/tmux ; then
|
|
|
|
for tmux in tests/bot-ci/deps/tmux/tmux-*/tmux ; do
|
|
|
|
export POWERLINE_TMUX_EXE="$PWD/$tmux"
|
2015-02-20 20:36:39 +01:00
|
|
|
test_tmux || true
|
2015-01-18 00:47:38 +01:00
|
|
|
done
|
|
|
|
else
|
2015-02-20 20:36:39 +01:00
|
|
|
export POWERLINE_TMUX_EXE="${POWERLINE_TMUX_EXE:-tmux}"
|
2015-01-18 00:47:38 +01:00
|
|
|
test_tmux || true
|
|
|
|
fi
|
2015-01-11 01:09:14 +01:00
|
|
|
|
|
|
|
if test $FAILED -eq 0 ; then
|
2015-08-21 17:39:52 +02:00
|
|
|
rm -rf tests/vterm_tmux
|
2015-08-22 16:18:35 +02:00
|
|
|
else
|
|
|
|
echo "$FAIL_SUMMARY"
|
2015-01-11 01:09:14 +01:00
|
|
|
fi
|
|
|
|
|
2015-08-22 16:18:35 +02:00
|
|
|
exit_suite
|