From d9c62d4796c73d8f7bd88c58c24f93b01e6adfd3 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 13 Jan 2014 19:47:58 +0400 Subject: [PATCH] Add zsh functional tests --- tests/install.sh | 1 + tests/test_shells/input.zsh | 14 ++++++++++++++ tests/test_shells/test.sh | 8 +++++++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/test_shells/input.zsh diff --git a/tests/install.sh b/tests/install.sh index 138da22a..4172395b 100755 --- a/tests/install.sh +++ b/tests/install.sh @@ -9,4 +9,5 @@ if python -c 'import sys; sys.exit(1 * (sys.version_info[0] != 2))' ; then pip install unittest2 argparse fi fi +apt-get install zsh true diff --git a/tests/test_shells/input.zsh b/tests/test_shells/input.zsh new file mode 100644 index 00000000..f3506642 --- /dev/null +++ b/tests/test_shells/input.zsh @@ -0,0 +1,14 @@ +unsetopt promptsp transientrprompt +POWERLINE_COMMAND=( $PWD/scripts/powerline -p $PWD/powerline/config_files ) ; VIRTUAL_ENV= +source powerline/bindings/zsh/powerline.zsh ; cd tests/shell/3rd +POWERLINE_COMMAND=( $POWERLINE_COMMAND -c ext.shell.theme=default_leftonly ) +cd .git +cd .. +VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" +VIRTUAL_ENV= +bash -c "echo \$\$>pid ; while true ; do sleep 0.1s ; done" & +false +kill `cat pid` ; sleep 1s +false +POWERLINE_COMMAND=( $POWERLINE_COMMAND -t default_leftonly.segment_data.hostname.args.only_if_ssh=false ) +exit diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index 52a87a86..75ef1752 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -15,7 +15,7 @@ run_test() { SH="$1" SESNAME="powerline-shell-test-$$" screen -L -c tests/test_shells/screenrc -d -m -S "$SESNAME" \ - env LANG=C BINDFILE="$BINDFILE" "$@" + env LANG=en_US.UTF-8 BINDFILE="$BINDFILE" "$@" screen -S "$SESNAME" -X readreg a tests/test_shells/input.$SH sleep 5s screen -S "$SESNAME" -p 0 -X width 300 1 @@ -44,5 +44,11 @@ if ! run_test bash --norc --noprofile -i ; then fi rm tests/shell/screen.log +if ! run_test zsh -f -i ; then + echo "Failed zsh" + FAILED=1 +fi +rm tests/shell/screen.log + rm -r tests/shell exit $FAILED