2017-12-02 17:25:01 +01:00
|
|
|
#!/bin/bash
|
2017-04-30 14:49:46 +02:00
|
|
|
. tests/shlib/common.sh
|
|
|
|
. tests/shlib/vterm.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
|
|
|
|
2017-05-21 15:09:54 +02:00
|
|
|
vterm_setup
|
2015-01-11 01:09:14 +01:00
|
|
|
|
2017-05-21 01:33:21 +02:00
|
|
|
ln -s "$(which env)" "$TEST_ROOT/path"
|
|
|
|
ln -s "$(which cut)" "$TEST_ROOT/path"
|
|
|
|
ln -s "$ROOT/scripts/powerline-render" "$TEST_ROOT/path"
|
|
|
|
ln -s "$ROOT/scripts/powerline-config" "$TEST_ROOT/path"
|
2017-04-30 12:25:44 +02: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
|
2017-05-21 01:33:21 +02:00
|
|
|
ln -sf "$(which "${POWERLINE_TMUX_EXE}")" "$TEST_ROOT/path/tmux"
|
2017-04-30 12:25:44 +02:00
|
|
|
f="$ROOT/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
|
|
|
|
}
|
|
|
|
|
2017-04-30 12:25:44 +02:00
|
|
|
if test -z "$POWERLINE_TMUX_EXE" && test -d "$ROOT/tests/bot-ci/deps/tmux"
|
|
|
|
then
|
|
|
|
for tmux in "$ROOT"/tests/bot-ci/deps/tmux/tmux-*/tmux ; do
|
|
|
|
export POWERLINE_TMUX_EXE="$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
|
|
|
|
2017-05-21 01:33:21 +02:00
|
|
|
vterm_shutdown
|
2015-01-11 01:09:14 +01:00
|
|
|
|
2015-08-22 16:18:35 +02:00
|
|
|
exit_suite
|