diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 12:38:06 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 12:38:06 +0000 |
commit | 695ad2c6d0b157d2969c9b946d9e3765113a61e7 (patch) | |
tree | eaab7e7e2523ad710afe779d532156258e40d5cc /tests/test_in_vterm/test_tmux.sh | |
parent | Initial commit. (diff) | |
download | powerline-695ad2c6d0b157d2969c9b946d9e3765113a61e7.tar.xz powerline-695ad2c6d0b157d2969c9b946d9e3765113a61e7.zip |
Adding upstream version 2.8.1.upstream/2.8.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_in_vterm/test_tmux.sh')
-rwxr-xr-x | tests/test_in_vterm/test_tmux.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/test_in_vterm/test_tmux.sh b/tests/test_in_vterm/test_tmux.sh new file mode 100755 index 0000000..ab4e007 --- /dev/null +++ b/tests/test_in_vterm/test_tmux.sh @@ -0,0 +1,44 @@ +#!/bin/bash +. tests/shlib/common.sh +. tests/shlib/vterm.sh + +enter_suite tmux final + +vterm_setup + +ln -s "$(command -v env)" "$TEST_ROOT/path" +ln -s "$(command -v cut)" "$TEST_ROOT/path" +ln -s "$ROOT/scripts/powerline-render" "$TEST_ROOT/path" +ln -s "$ROOT/scripts/powerline-config" "$TEST_ROOT/path" + +test_tmux() { + if test "$PYTHON_IMPLEMENTATION" = PyPy; then + # FIXME PyPy3 segfaults for some reason, PyPy does it as well, but + # occasionally. + return 0 + fi + if ! command -v "${POWERLINE_TMUX_EXE}" ; then + return 0 + fi + ln -sf "$(command -v "${POWERLINE_TMUX_EXE}")" "$TEST_ROOT/path/tmux" + f="$ROOT/tests/test_in_vterm/test_tmux.py" + if ! "${PYTHON}" "$f" ; then + local test_name="$("$POWERLINE_TMUX_EXE" -V 2>&1 | cut -d' ' -f2)" + fail "$test_name" F "Failed vterm test $f" + fi +} + +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" + test_tmux || true + done +else + export POWERLINE_TMUX_EXE="${POWERLINE_TMUX_EXE:-tmux}" + test_tmux || true +fi + +vterm_shutdown + +exit_suite |