Hide test/vterm_tmux in env variable, use absolute paths

This commit is contained in:
Foo 2017-04-30 13:25:44 +03:00
parent 1b3aacb837
commit 65130ae6ff
2 changed files with 21 additions and 18 deletions

View File

@ -35,7 +35,7 @@ fail() {
local full_msg="$fail_char $POWERLINE_CURRENT_SUITE|$test_name :: $message" local full_msg="$fail_char $POWERLINE_CURRENT_SUITE|$test_name :: $message"
FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}" FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}"
echo "Failed: $full_msg" echo "Failed: $full_msg"
echo "$full_msg" >> tests/failures echo "$full_msg" >> "$ROOT/tests/failures"
if test "x$allow_failure" = "x" ; then if test "x$allow_failure" = "x" ; then
FAILED=1 FAILED=1
fi fi

View File

@ -3,18 +3,20 @@
enter_suite tmux enter_suite tmux
rm -rf tests/vterm_tmux VTERM_TEST_DIR="$ROOT/tests/vterm_tmux"
mkdir tests/vterm_tmux
mkdir tests/vterm_tmux/path
ln -s "$(which "${PYTHON}")" tests/vterm_tmux/path/python rm -rf "$VTERM_TEST_DIR"
ln -s "$(which bash)" tests/vterm_tmux/path mkdir "$VTERM_TEST_DIR"
ln -s "$(which env)" tests/vterm_tmux/path mkdir "$VTERM_TEST_DIR/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
cp -r tests/terminfo tests/vterm_tmux ln -s "$(which "${PYTHON}")" "$VTERM_TEST_DIR/path/python"
ln -s "$(which bash)" "$VTERM_TEST_DIR/path"
ln -s "$(which env)" "$VTERM_TEST_DIR/path"
ln -s "$(which cut)" "$VTERM_TEST_DIR/path"
ln -s "$ROOT/scripts/powerline-render" "$VTERM_TEST_DIR/path"
ln -s "$ROOT/scripts/powerline-config" "$VTERM_TEST_DIR/path"
cp -r "$ROOT/tests/terminfo" "$VTERM_TEST_DIR"
test_tmux() { test_tmux() {
if test "$PYTHON_IMPLEMENTATION" = PyPy; then if test "$PYTHON_IMPLEMENTATION" = PyPy; then
@ -25,17 +27,18 @@ test_tmux() {
if ! which "${POWERLINE_TMUX_EXE}" ; then if ! which "${POWERLINE_TMUX_EXE}" ; then
return 0 return 0
fi fi
ln -sf "$(which "${POWERLINE_TMUX_EXE}")" tests/vterm_tmux/path ln -sf "$(which "${POWERLINE_TMUX_EXE}")" "$VTERM_TEST_DIR/path"
f=tests/test_in_vterm/test_tmux.py f="$ROOT/tests/test_in_vterm/test_tmux.py"
if ! "${PYTHON}" $f ; then if ! "${PYTHON}" "$f" ; then
local test_name="$("$POWERLINE_TMUX_EXE" -V 2>&1 | cut -d' ' -f2)" local test_name="$("$POWERLINE_TMUX_EXE" -V 2>&1 | cut -d' ' -f2)"
fail "$test_name" F "Failed vterm test $f" fail "$test_name" F "Failed vterm test $f"
fi fi
} }
if test -z "$POWERLINE_TMUX_EXE" && test -d tests/bot-ci/deps/tmux ; then if test -z "$POWERLINE_TMUX_EXE" && test -d "$ROOT/tests/bot-ci/deps/tmux"
for tmux in tests/bot-ci/deps/tmux/tmux-*/tmux ; do then
export POWERLINE_TMUX_EXE="$PWD/$tmux" for tmux in "$ROOT"/tests/bot-ci/deps/tmux/tmux-*/tmux ; do
export POWERLINE_TMUX_EXE="$tmux"
test_tmux || true test_tmux || true
done done
else else
@ -44,7 +47,7 @@ else
fi fi
if test $FAILED -eq 0 ; then if test $FAILED -eq 0 ; then
rm -rf tests/vterm_tmux rm -rf "$VTERM_TEST_DIR"
else else
echo "$FAIL_SUMMARY" echo "$FAIL_SUMMARY"
fi fi