diff --git a/tests/test_shells/bash.daemon.ok b/tests/test_shells/bash.daemon.ok index 50d7d212..a0aba45b 100644 --- a/tests/test_shells/bash.daemon.ok +++ b/tests/test_shells/bash.daemon.ok @@ -1,23 +1,23 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh [1] PID -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s [1]+ Terminated bgscript.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false - USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false -  BRANCH  …  tests  shell  3rd  echo ' -                                     abc -                                     def -                                     ' +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false + USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false +  BRANCH  …  tmp  shell  3rd  echo ' +                                   abc +                                   def +                                   ' abc def -  BRANCH  …  tests  shell  3rd  cd "$DIR1" +  BRANCH  …  tmp  shell  3rd  cd "$DIR1"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  \[\]  cd ../'%%' diff --git a/tests/test_shells/bash.nodaemon.ok b/tests/test_shells/bash.nodaemon.ok index 9571a21c..118dfe50 100644 --- a/tests/test_shells/bash.nodaemon.ok +++ b/tests/test_shells/bash.nodaemon.ok @@ -1,15 +1,15 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh [1] PID -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s [1]+ Terminated bgscript.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false - USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false -  BRANCH  …  tests  shell  3rd  echo ' +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false + USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false +  BRANCH  …  tmp  shell  3rd  echo '    abc    def    ' @@ -17,7 +17,7 @@ abc def -  BRANCH  …  tests  shell  3rd  cd "$DIR1" +  BRANCH  …  tmp  shell  3rd  cd "$DIR1"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  \[\]  cd ../'%%' diff --git a/tests/test_shells/busybox.daemon.ok b/tests/test_shells/busybox.daemon.ok index a8c3faa5..446d88e8 100644 --- a/tests/test_shells/busybox.daemon.ok +++ b/tests/test_shells/busybox.daemon.ok @@ -1,22 +1,22 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s [1]+ Terminated bgscript.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  set_theme_option default_leftonly.segment_data.hostname.display false - USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false -  BRANCH  …  tests  shell  3rd  echo ' -                                     abc -                                     def -                                     ' +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  set_theme_option default_leftonly.segment_data.hostname.display false + USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false +  BRANCH  …  tmp  shell  3rd  echo ' +                                   abc +                                   def +                                   ' abc def -  BRANCH  …  tests  shell  3rd  cd "$DIR1" +  BRANCH  …  tmp  shell  3rd  cd "$DIR1"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  \[\]  cd ../'%%' diff --git a/tests/test_shells/busybox.nodaemon.ok b/tests/test_shells/busybox.nodaemon.ok index 00b8b7cc..afda9a58 100644 --- a/tests/test_shells/busybox.nodaemon.ok +++ b/tests/test_shells/busybox.nodaemon.ok @@ -1,14 +1,14 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s [1]+ Terminated bgscript.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  set_theme_option default_leftonly.segment_data.hostname.display false - USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false -  BRANCH  …  tests  shell  3rd  echo ' +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  set_theme_option default_leftonly.segment_data.hostname.display false + USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false +  BRANCH  …  tmp  shell  3rd  echo '    abc    def    ' @@ -16,7 +16,7 @@ abc def -  BRANCH  …  tests  shell  3rd  cd "$DIR1" +  BRANCH  …  tmp  shell  3rd  cd "$DIR1"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  \[\]  cd ../'%%' diff --git a/tests/test_shells/dash.daemon.ok b/tests/test_shells/dash.daemon.ok index bfe8fab0..71ca5003 100644 --- a/tests/test_shells/dash.daemon.ok +++ b/tests/test_shells/dash.daemon.ok @@ -1,21 +1,21 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s set_theme_option default_leftonly.segment_data.hostname.display false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1   USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false -  BRANCH  …  tests  shell  3rd  echo ' -                                     abc -                                     def -                                     ' +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1   USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false +  BRANCH  …  tmp  shell  3rd  echo ' +                                   abc +                                   def +                                   ' abc def -  BRANCH  …  tests  shell  3rd  cd "$DIR1" +  BRANCH  …  tmp  shell  3rd  cd "$DIR1"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  \[\]  cd ../'%%' diff --git a/tests/test_shells/dash.nodaemon.ok b/tests/test_shells/dash.nodaemon.ok index c4f8e567..c289cd2e 100644 --- a/tests/test_shells/dash.nodaemon.ok +++ b/tests/test_shells/dash.nodaemon.ok @@ -1,13 +1,13 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s set_theme_option default_leftonly.segment_data.hostname.display false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1   USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false -  BRANCH  …  tests  shell  3rd  echo ' +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1   USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false +  BRANCH  …  tmp  shell  3rd  echo '    abc    def    ' @@ -15,7 +15,7 @@ set_theme_option default_leftonly.segment_data.hostname.display false abc def -  BRANCH  …  tests  shell  3rd  cd "$DIR1" +  BRANCH  …  tmp  shell  3rd  cd "$DIR1"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  \[\]  cd ../'%%' diff --git a/tests/test_shells/fish.ok b/tests/test_shells/fish.ok index 973cf05a..4d208bb1 100644 --- a/tests/test_shells/fish.ok +++ b/tests/test_shells/fish.ok @@ -1,11 +1,11 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd     HOSTNAME  USER   BRANCH  …  shell  3rd  .git   -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd   -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd   -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd   -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1   -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1   -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd   +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd     HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m     HOSTNAME  USER   BRANCH  …  shell  3rd  ^H     HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]   diff --git a/tests/test_shells/input.bash b/tests/test_shells/input.bash index bbd8d0bb..beffd308 100644 --- a/tests/test_shells/input.bash +++ b/tests/test_shells/input.bash @@ -32,7 +32,7 @@ ABOVE_FULL='[{ set_theme default_leftonly export VIRTUAL_ENV= source powerline/bindings/bash/powerline.sh -cd tests/shell/3rd +cd "$TEST_ROOT"/3rd cd .git cd .. VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" diff --git a/tests/test_shells/input.busybox b/tests/test_shells/input.busybox index 16824d7b..5d1495a0 100644 --- a/tests/test_shells/input.busybox +++ b/tests/test_shells/input.busybox @@ -8,7 +8,7 @@ set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false set_theme default_leftonly . powerline/bindings/shell/powerline.sh export VIRTUAL_ENV= -cd tests/shell/3rd +cd "$TEST_ROOT"/3rd cd .git cd .. VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" diff --git a/tests/test_shells/input.dash b/tests/test_shells/input.dash index 16824d7b..5d1495a0 100644 --- a/tests/test_shells/input.dash +++ b/tests/test_shells/input.dash @@ -8,7 +8,7 @@ set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false set_theme default_leftonly . powerline/bindings/shell/powerline.sh export VIRTUAL_ENV= -cd tests/shell/3rd +cd "$TEST_ROOT"/3rd cd .git cd .. VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" diff --git a/tests/test_shells/input.fish b/tests/test_shells/input.fish index 4be37c31..9a20613a 100644 --- a/tests/test_shells/input.fish +++ b/tests/test_shells/input.fish @@ -37,7 +37,7 @@ while jobs | grep fish_update_completions end powerline-setup setenv VIRTUAL_ENV -cd tests/shell/3rd +cd "$TEST_ROOT"/3rd cd .git cd .. setenv VIRTUAL_ENV "$HOME/.virtenvs/some-virtual-environment" diff --git a/tests/test_shells/input.ipython b/tests/test_shells/input.ipython index 23b80198..257cba6f 100644 --- a/tests/test_shells/input.ipython +++ b/tests/test_shells/input.ipython @@ -1,4 +1,4 @@ -print ('cd ' + 'tests/shell/3rd') # Start of the test marker +print ('cd ' + '"$TEST_ROOT"/3rd') # Start of the test marker bool 42 bool 44 class Test(object): diff --git a/tests/test_shells/input.mksh b/tests/test_shells/input.mksh index 1656800e..ca457835 100644 --- a/tests/test_shells/input.mksh +++ b/tests/test_shells/input.mksh @@ -8,7 +8,7 @@ set_theme default_leftonly set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false . powerline/bindings/shell/powerline.sh export VIRTUAL_ENV= -cd tests/shell/3rd +cd "$TEST_ROOT"/3rd cd .git cd .. VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" diff --git a/tests/test_shells/input.rc b/tests/test_shells/input.rc index 1ae37ff0..c88bcf93 100644 --- a/tests/test_shells/input.rc +++ b/tests/test_shells/input.rc @@ -5,7 +5,8 @@ set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false POWERLINE_CONFIG_OVERRIDES = 'ext.shell.theme=default_leftonly' . powerline/bindings/rc/powerline.rc VIRTUAL_ENV = () -cd tests/shell/3rd +cd $TEST_ROOT/3rd +true cd "$TEST_ROOT"/3rd # Test start marker cd .git cd .. VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment' diff --git a/tests/test_shells/input.tcsh b/tests/test_shells/input.tcsh index 509c7ae6..c7d722a6 100644 --- a/tests/test_shells/input.tcsh +++ b/tests/test_shells/input.tcsh @@ -2,7 +2,7 @@ setenv POWERLINE_THEME_OVERRIDES "default_leftonly.segment_data.hostname.args.on setenv POWERLINE_CONFIG_OVERRIDES "ext.shell.theme=default_leftonly" source powerline/bindings/tcsh/powerline.tcsh unsetenv VIRTUAL_ENV -cd tests/shell/3rd +cd "$TEST_ROOT"/3rd cd .git cd .. setenv VIRTUAL_ENV "/home/foo/.virtenvs/some-virtual-environment" diff --git a/tests/test_shells/input.zsh b/tests/test_shells/input.zsh index ce29ddce..811684e0 100644 --- a/tests/test_shells/input.zsh +++ b/tests/test_shells/input.zsh @@ -43,7 +43,7 @@ ABOVE_FULL='[{ }]' set_theme default_leftonly export VIRTUAL_ENV= -cd tests/shell/3rd +cd "$TEST_ROOT"/3rd cd .git cd .. VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment" diff --git a/tests/test_shells/mksh.daemon.ok b/tests/test_shells/mksh.daemon.ok index 2a367dcf..264dff87 100644 --- a/tests/test_shells/mksh.daemon.ok +++ b/tests/test_shells/mksh.daemon.ok @@ -1,25 +1,25 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh [1] PID -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1 +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1 [1] + Terminated bash -c ... -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false - USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false -  BRANCH  …  tests  shell  3rd  echo -n -  BRANCH  …  tests  shell  3rd  echo ' -                                     abc -                                     def -                                     ' +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false + USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false +  BRANCH  …  tmp  shell  3rd  echo -n +  BRANCH  …  tmp  shell  3rd  echo ' +                                   abc +                                   def +                                   ' abc def -  BRANCH  …  tests  shell  3rd  cd "$DIR1" +  BRANCH  …  tmp  shell  3rd  cd "$DIR1"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  \[\]  cd ../'%%' diff --git a/tests/test_shells/mksh.nodaemon.ok b/tests/test_shells/mksh.nodaemon.ok index 09190f8d..d8d9d705 100644 --- a/tests/test_shells/mksh.nodaemon.ok +++ b/tests/test_shells/mksh.nodaemon.ok @@ -1,17 +1,17 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh [1] PID -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1 +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1 [1] + Terminated bash -c ... -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false - USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false -  BRANCH  …  tests  shell  3rd  echo -n -  BRANCH  …  tests  shell  3rd  echo ' +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false + USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false +  BRANCH  …  tmp  shell  3rd  echo -n +  BRANCH  …  tmp  shell  3rd  echo '    abc    def    ' @@ -19,7 +19,7 @@ abc def -  BRANCH  …  tests  shell  3rd  cd "$DIR1" +  BRANCH  …  tmp  shell  3rd  cd "$DIR1"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  \[\]  cd ../'%%' diff --git a/tests/test_shells/postproc.py b/tests/test_shells/postproc.py index 9b2a19a3..79261554 100755 --- a/tests/test_shells/postproc.py +++ b/tests/test_shells/postproc.py @@ -10,12 +10,13 @@ import platform import re +test_root = os.environ['TEST_ROOT'] test_type = sys.argv[1] test_client = sys.argv[2] shell = sys.argv[3] -fname = os.path.join('tests', 'shell', '.'.join((shell, test_type, test_client, 'full.log'))) -new_fname = os.path.join('tests', 'shell', '.'.join((shell, test_type, test_client, 'log'))) -pid_fname = os.path.join('tests', 'shell', '3rd', 'pid') +fname = os.path.join(test_root, '.'.join((shell, test_type, test_client, 'full.log'))) +new_fname = os.path.join(test_root, '.'.join((shell, test_type, test_client, 'log'))) +pid_fname = os.path.join(test_root, '3rd', 'pid') is_pypy = platform.python_implementation() == 'PyPy' @@ -32,7 +33,7 @@ REFS_RE = re.compile(r'^\[\d+ refs\]\n') IPYPY_DEANSI_RE = re.compile(r'\033(?:\[(?:\?\d+[lh]|[^a-zA-Z]+[a-ln-zA-Z])|[=>])') ZSH_HL_RE = re.compile(r'\033\[\?\d+[hl]') -start_str = 'cd tests/shell/3rd' +start_str = 'cd "$TEST_ROOT"/3rd' if shell == 'pdb': start_str = 'class Foo(object):' diff --git a/tests/test_shells/rc.daemon.ok b/tests/test_shells/rc.daemon.ok index 9bbee845..c49b9a32 100644 --- a/tests/test_shells/rc.daemon.ok +++ b/tests/test_shells/rc.daemon.ok @@ -1,12 +1,12 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment' -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV = () -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment' +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV = () +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh PID -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `{cat pid} ; sleep 1s -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd $DIR1 +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `{cat pid} ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd $DIR1   HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m  cd ../$DIR2   HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%' diff --git a/tests/test_shells/rc.nodaemon.ok b/tests/test_shells/rc.nodaemon.ok index d45c7bd3..28376cb5 100644 --- a/tests/test_shells/rc.nodaemon.ok +++ b/tests/test_shells/rc.nodaemon.ok @@ -1,12 +1,12 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment' -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV = () -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment' +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV = () +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh PID -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `{cat pid} ; sleep 1s -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd $DIR1 +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `{cat pid} ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd $DIR1   HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m  cd ../$DIR2   HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%' diff --git a/tests/test_shells/run_script.py b/tests/test_shells/run_script.py index 3d5eddd5..90b20f5b 100755 --- a/tests/test_shells/run_script.py +++ b/tests/test_shells/run_script.py @@ -25,6 +25,7 @@ def get_argparser(ArgumentParser=argparse.ArgumentParser): def main(): + test_root = os.environ['TEST_ROOT'] parser = get_argparser() args = parser.parse_args() @@ -33,11 +34,10 @@ def main(): test_client = args.client or test_type log_file_base = '{0}.{1}.{2}'.format(shell, test_type, test_client) - full_log_file_name = os.path.join('tests', 'shell', '{0}.full.log'.format(log_file_base)) - # postproc_log_file_name = os.path.join('tests', 'shell', '{0}.log'.format(log_file_base)) + full_log_file_name = os.path.join(test_root, '{0}.full.log'.format(log_file_base)) local_paths = [ - os.path.abspath(os.path.join('tests', 'shell', 'path')), + os.path.abspath(os.path.join(test_root, 'path')), os.path.abspath('scripts'), ] @@ -55,8 +55,8 @@ def main(): 'TERM': 'screen-256color', 'DIR1': os.environ['DIR1'], 'DIR2': os.environ['DIR2'], - 'XDG_CONFIG_HOME': os.path.abspath(os.path.join('tests', 'shell', 'fish_home')), - 'IPYTHONDIR': os.path.abspath(os.path.join('tests', 'shell', 'ipython_home')), + 'XDG_CONFIG_HOME': os.path.abspath(os.path.join(test_root, 'fish_home')), + 'IPYTHONDIR': os.path.abspath(os.path.join(test_root, 'ipython_home')), 'PYTHONPATH': python_paths, 'POWERLINE_CONFIG_OVERRIDES': os.environ.get('POWERLINE_CONFIG_OVERRIDES', ''), 'POWERLINE_THEME_OVERRIDES': os.environ.get('POWERLINE_THEME_OVERRIDES', ''), @@ -64,6 +64,7 @@ def main(): 'POWERLINE_COMMAND_ARGS': os.environ.get('POWERLINE_COMMAND_ARGS', ''), 'POWERLINE_COMMAND': os.environ.get('POWERLINE_COMMAND', ''), 'LD_LIBRARY_PATH': os.environ.get('LD_LIBRARY_PATH', ''), + 'TEST_ROOT': test_root, } os.environ['PATH'] = environ['PATH'] @@ -111,11 +112,11 @@ def main(): child.close(force=True) check_call([ - os.path.join('tests', 'shell', 'path', 'python'), + os.path.join(test_root, 'path', 'python'), os.path.join('tests', 'test_shells', 'postproc.py'), test_type, test_client, shell ]) - pidfile = os.path.join('tests', 'shell', '3rd', 'pid') + pidfile = os.path.join(test_root, '3rd', 'pid') if os.path.exists(pidfile): os.unlink(pidfile) diff --git a/tests/test_shells/tcsh.ok b/tests/test_shells/tcsh.ok index 3b25f86f..07089bff 100644 --- a/tests/test_shells/tcsh.ok +++ b/tests/test_shells/tcsh.ok @@ -1,11 +1,11 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd     HOSTNAME  USER   BRANCH  …  shell  3rd  .git   -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd   -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd   -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd   -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd   -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1   -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd   +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1   +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd     HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m     HOSTNAME  USER   BRANCH  …  shell  3rd  ^H     HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]   diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index 590284b8..42bf9d41 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -1,7 +1,7 @@ #!/bin/sh . tests/shlib/common.sh -enter_suite shells +enter_suite shell if test $# -eq 0 ; then FAST=1 @@ -28,14 +28,14 @@ check_screen_log() { TEST_TYPE="$1" TEST_CLIENT="$2" SH="$3" - if test -e tests/test_shells/${SH}.${TEST_TYPE}.ok ; then - diff -a -u tests/test_shells/${SH}.${TEST_TYPE}.ok tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log + if test -e "$ROOT/tests/test_shells/${SH}.${TEST_TYPE}.ok" ; then + diff -a -u "$ROOT/tests/test_shells/${SH}.${TEST_TYPE}.ok" "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log" return $? - elif test -e tests/test_shells/${SH}.ok ; then - diff -a -u tests/test_shells/${SH}.ok tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log + elif test -e "$ROOT/tests/test_shells/${SH}.ok" ; then + diff -a -u "$ROOT/tests/test_shells/${SH}.ok" "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log" return $? else - cat tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log + cat "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log" return 1 fi } @@ -50,13 +50,13 @@ print_full_output() { SH="$3" echo "Full output:" echo '============================================================' - cat tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log + cat "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log" echo echo '____________________________________________________________' if test "x$POWERLINE_TEST_NO_CAT_V" != "x1" ; then echo "Full output (cat -v):" echo '============================================================' - cat -v tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log + cat -v "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log" echo echo '____________________________________________________________' fi @@ -104,9 +104,9 @@ do_run_test() { fi echo -n "Failed ${SH}. " print_full_output ${TEST_TYPE} ${TEST_CLIENT} ${SH} - case ${SH} in + case "${SH}" in *ksh) - ${SH} -c 'echo ${KSH_VERSION}' + "$TEST_ROOT/path/${SH}" -c 'echo ${KSH_VERSION}' ;; dash) # ? @@ -115,7 +115,7 @@ do_run_test() { busybox --help ;; *) - ${SH} --version + "$TEST_ROOT/path/${SH}" --version ;; esac if which dpkg >/dev/null ; then @@ -135,82 +135,82 @@ run_test() { attempts=1 fi while test $attempts -gt 0 ; do - rm -f tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log - rm -f tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log + rm -f "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log" + rm -f "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log" do_run_test "$@" && return 0 attempts=$(( attempts - 1 )) done return 1 } -test -d tests/shell && rm -r tests/shell -mkdir tests/shell -git init tests/shell/3rd -git --git-dir=tests/shell/3rd/.git checkout -b BRANCH +make_test_root + +git init "$TEST_ROOT/3rd" +git --git-dir="$TEST_ROOT/3rd/.git" checkout -b BRANCH export DIR1="" export DIR2="" -mkdir tests/shell/3rd/"$DIR1" -mkdir tests/shell/3rd/"$DIR2" -mkdir tests/shell/3rd/'\[\]' -mkdir tests/shell/3rd/'%%' -mkdir tests/shell/3rd/'#[bold]' -mkdir tests/shell/3rd/'(echo)' -mkdir tests/shell/3rd/'$(echo)' -mkdir tests/shell/3rd/'`echo`' -mkdir tests/shell/3rd/'«Unicode!»' +mkdir "$TEST_ROOT/3rd/$DIR1" +mkdir "$TEST_ROOT/3rd/$DIR2" +mkdir "$TEST_ROOT"/3rd/'\[\]' +mkdir "$TEST_ROOT"/3rd/'%%' +mkdir "$TEST_ROOT"/3rd/'#[bold]' +mkdir "$TEST_ROOT"/3rd/'(echo)' +mkdir "$TEST_ROOT"/3rd/'$(echo)' +mkdir "$TEST_ROOT"/3rd/'`echo`' +mkdir "$TEST_ROOT"/3rd/'«Unicode!»' -mkdir tests/shell/fish_home -mkdir tests/shell/fish_home/fish -mkdir tests/shell/fish_home/fish/generated_completions -cp -r tests/test_shells/ipython_home tests/shell +mkdir "$TEST_ROOT/fish_home" +mkdir "$TEST_ROOT/fish_home/fish" +mkdir "$TEST_ROOT/fish_home/fish/generated_completions" +cp -r "$ROOT/tests/test_shells/ipython_home" "$TEST_ROOT" -mkdir tests/shell/path -ln -s "$(which "${PYTHON}")" tests/shell/path/python -ln -s "$(which env)" tests/shell/path -ln -s "$(which git)" tests/shell/path -ln -s "$(which sleep)" tests/shell/path -ln -s "$(which cat)" tests/shell/path -ln -s "$(which false)" tests/shell/path -ln -s "$(which true)" tests/shell/path -ln -s "$(which kill)" tests/shell/path -ln -s "$(which echo)" tests/shell/path -ln -s "$(which which)" tests/shell/path -ln -s "$(which dirname)" tests/shell/path -ln -s "$(which wc)" tests/shell/path -ln -s "$(which stty)" tests/shell/path -ln -s "$(which cut)" tests/shell/path -ln -s "$(which bc)" tests/shell/path -ln -s "$(which expr)" tests/shell/path -ln -s "$(which mktemp)" tests/shell/path -ln -s "$(which grep)" tests/shell/path -ln -s "$(which sed)" tests/shell/path -ln -s "$(which rm)" tests/shell/path -ln -s "$(which tr)" tests/shell/path -ln -s "$(which uname)" tests/shell/path -ln -s "$(which test)" tests/shell/path -ln -s "$(which pwd)" tests/shell/path -ln -s "$(which hostname)" tests/shell/path -ln -s ../../test_shells/bgscript.sh tests/shell/path -ln -s ../../test_shells/waitpid.sh tests/shell/path +mkdir "$TEST_ROOT/path" +ln -s "$(which "${PYTHON}")" "$TEST_ROOT/path/python" +ln -s "$(which env)" "$TEST_ROOT/path" +ln -s "$(which git)" "$TEST_ROOT/path" +ln -s "$(which sleep)" "$TEST_ROOT/path" +ln -s "$(which cat)" "$TEST_ROOT/path" +ln -s "$(which false)" "$TEST_ROOT/path" +ln -s "$(which true)" "$TEST_ROOT/path" +ln -s "$(which kill)" "$TEST_ROOT/path" +ln -s "$(which echo)" "$TEST_ROOT/path" +ln -s "$(which which)" "$TEST_ROOT/path" +ln -s "$(which dirname)" "$TEST_ROOT/path" +ln -s "$(which wc)" "$TEST_ROOT/path" +ln -s "$(which stty)" "$TEST_ROOT/path" +ln -s "$(which cut)" "$TEST_ROOT/path" +ln -s "$(which bc)" "$TEST_ROOT/path" +ln -s "$(which expr)" "$TEST_ROOT/path" +ln -s "$(which mktemp)" "$TEST_ROOT/path" +ln -s "$(which grep)" "$TEST_ROOT/path" +ln -s "$(which sed)" "$TEST_ROOT/path" +ln -s "$(which rm)" "$TEST_ROOT/path" +ln -s "$(which tr)" "$TEST_ROOT/path" +ln -s "$(which uname)" "$TEST_ROOT/path" +ln -s "$(which test)" "$TEST_ROOT/path" +ln -s "$(which pwd)" "$TEST_ROOT/path" +ln -s "$(which hostname)" "$TEST_ROOT/path" +ln -s "$ROOT/tests/test_shells/bgscript.sh" "$TEST_ROOT/path" +ln -s "$ROOT/tests/test_shells/waitpid.sh" "$TEST_ROOT/path" if which socat ; then - ln -s "$(which socat)" tests/shell/path + ln -s "$(which socat)" "$TEST_ROOT/path" fi for pexe in powerline powerline-config powerline-render powerline.sh powerline.py ; do - if test -e scripts/$pexe ; then - ln -s "$PWD/scripts/$pexe" tests/shell/path + if test -e "$ROOT/scripts/$pexe" ; then + ln -s "$ROOT/scripts/$pexe" "$TEST_ROOT/path" elif test -e client/$pexe ; then - ln -s "$PWD/client/$pexe" tests/shell/path + ln -s "$ROOT/client/$pexe" "$TEST_ROOT/path" elif which $pexe ; then - ln -s "$(which $pexe)" tests/shell/path + ln -s "$(which $pexe)" "$TEST_ROOT/path" else echo "Executable $pexe was not found" exit 1 fi done -ln -s python tests/shell/path/pdb +ln -s python "$TEST_ROOT/path/pdb" PDB_PYTHON=pdb -ln -s python tests/shell/path/ipython +ln -s python "$TEST_ROOT/path/ipython" IPYTHON_PYTHON=ipython if test -z "$POWERLINE_RC_EXE" ; then @@ -224,7 +224,7 @@ if test -z "$POWERLINE_RC_EXE" ; then fi if which "$POWERLINE_RC_EXE" >/dev/null ; then - ln -s "$(which $POWERLINE_RC_EXE)" tests/shell/path/rc + ln -s "$(which $POWERLINE_RC_EXE)" "$TEST_ROOT/path/rc" fi for exe in bash zsh busybox fish tcsh mksh dash ; do @@ -256,12 +256,12 @@ for exe in bash zsh busybox fish tcsh mksh dash ; do fi fi fi - ln -s "$(which $exe)" tests/shell/path + ln -s "$(which $exe)" "$TEST_ROOT/path" fi done -mkdir tests/shell/home -export HOME="$PWD/tests/shell/home" +mkdir "$TEST_ROOT/home" +export HOME="$TEST_ROOT/home" unset ENV @@ -272,7 +272,10 @@ echo "Powerline address: $ADDRESS" check_test_client() { local executable="$1" local client_type="$2" - local actual_mime_type="$(file --mime-type --brief --dereference "tests/shell/path/$executable" | cut -d/ -f1)" + local actual_mime_type="$( + file --mime-type --brief --dereference "$TEST_ROOT/path/$executable" \ + | cut -d/ -f1 + )" local expected_mime_type case "$client_type" in C) expected_mime_type="application/x-executable" ;; @@ -286,14 +289,20 @@ check_test_client() { fi } -if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || test "x${ONLY_SHELL}" = xbusybox || test "x${ONLY_SHELL}" = xrc ; then +if ( \ + test -z "${ONLY_SHELL}" \ + || test "${ONLY_SHELL%sh}" != "${ONLY_SHELL}" \ + || test "${ONLY_SHELL}" = "busybox" \ + || test "${ONLY_SHELL}" = "rc" \ +) ; then scripts/powerline-config shell command for TEST_TYPE in "daemon" "nodaemon" ; do - if test "x$ONLY_TEST_TYPE" != "x" && test "x$ONLY_TEST_TYPE" != "x$TEST_TYPE" ; then + if test -n "$ONLY_TEST_TYPE" && test "$ONLY_TEST_TYPE" != "$TEST_TYPE" + then continue fi - if test x$FAST = x1 ; then + if test "$FAST" = 1 ; then if test $TEST_TYPE = daemon ; then VARIANTS=3 else @@ -305,8 +314,8 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te if test $TEST_TYPE = daemon ; then sh -c ' - echo $$ > tests/shell/daemon_pid - exec $PYTHON ./scripts/powerline-daemon -s$ADDRESS -f >tests/shell/daemon_log 2>&1 + echo $$ > "$TEST_ROOT/daemon_pid" + exec "$PYTHON" ./scripts/powerline-daemon -s"$ADDRESS" -f >"$TEST_ROOT/daemon_log" 2>&1 ' & fi echo "> Testing $TEST_TYPE" @@ -328,17 +337,24 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te continue fi I="$(( I + 1 ))" - if test "$TEST_CLIENT" = "C" && ! test -x scripts/powerline ; then + if test "$TEST_CLIENT" = "C" && ! test -x "$ROOT/scripts/powerline" + then if which powerline >/dev/null ; then POWERLINE_COMMAND=powerline else continue fi fi - if test "$TEST_CLIENT" = "shell" && ! test -x tests/shell/path/socat ; then + if ( \ + test "$TEST_CLIENT" = "shell" \ + && ! test -x "$TEST_ROOT/path/socat" \ + ) ; then continue fi - if test "x$ONLY_TEST_CLIENT" != "x" && test "x$TEST_CLIENT" != "x$ONLY_TEST_CLIENT" ; then + if ( \ + test -n "$ONLY_TEST_CLIENT" \ + && test "$TEST_CLIENT" != "$ONLY_TEST_CLIENT" \ + ) ; then continue fi export POWERLINE_COMMAND_ARGS="--socket $ADDRESS" @@ -356,19 +372,19 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te "rc -i -p" do J="$(( J + 1 ))" - if test x$FAST = x1 ; then + if test "$FAST" = 1 ; then if test $(( (I + J) % $VARIANTS )) -ne $EXETEST ; then continue fi fi SH="${TEST_COMMAND%% *}" - if test "x$ONLY_SHELL" != "x" && test "x$ONLY_SHELL" != "x$SH" ; then + if test "$ONLY_SHELL" != "" && test "x$ONLY_SHELL" != "x$SH" ; then continue fi - if ! test -x tests/shell/path/$SH ; then + if ! test -x "$TEST_ROOT/path/$SH" ; then continue fi - echo ">>> $(readlink "tests/shell/path/$SH")" + echo ">>> $(readlink "$TEST_ROOT/path/$SH")" if ! run_test $TEST_TYPE $TEST_CLIENT $TEST_COMMAND ; then ALLOW_FAILURE_ARG= # dash tests are not stable, see #931 @@ -376,70 +392,82 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te if test x$FAST$SH = x1dash || test x$FAST$SH = x1fish ; then ALLOW_FAILURE_ARG="--allow-failure" fi - fail $ALLOW_FAILURE_ARG "$SH-$TEST_TYPE-$TEST_CLIENT:test" F "Failed checking $TEST_COMMAND" + fail $ALLOW_FAILURE_ARG "$SH-$TEST_TYPE-$TEST_CLIENT:test" F \ + "Failed checking $TEST_COMMAND" fi done done if test $TEST_TYPE = daemon ; then - $PYTHON ./scripts/powerline-daemon -s$ADDRESS -k - wait $(cat tests/shell/daemon_pid) - if ! test -z "$(cat tests/shell/daemon_log)" ; then + "$PYTHON" ./scripts/powerline-daemon -s"$ADDRESS" -k + wait $(cat "$TEST_ROOT/daemon_pid") + if ! test -z "$(cat "$TEST_ROOT/daemon_log")" ; then echo '____________________________________________________________' echo "Daemon log:" echo '============================================================' - cat tests/shell/daemon_log - fail "$SH-$TEST_TYPE-$TEST_CLIENT:log" E "Non-empty daemon log for ${TEST_COMMAND}" + cat "$TEST_ROOT/daemon_log" + fail "$SH-$TEST_TYPE-$TEST_CLIENT:log" E \ + "Non-empty daemon log for ${TEST_COMMAND}" fi fi done fi -if $PYTHON scripts/powerline-daemon -s$ADDRESS > tests/shell/daemon_log_2 2>&1 ; then +if "$PYTHON" scripts/powerline-daemon -s"$ADDRESS" \ + > "$TEST_ROOT/daemon_log_2" 2>&1 +then sleep 1 - $PYTHON scripts/powerline-daemon -s$ADDRESS -k + "$PYTHON" scripts/powerline-daemon -s"$ADDRESS" -k else fail "daemon:run" F "Daemon exited with status $?" fi -if ! test -z "$(cat tests/shell/daemon_log_2)" ; then +if ! test -z "$(cat "$TEST_ROOT/daemon_log_2")" ; then echo '____________________________________________________________' echo "Daemon log (2nd):" echo '============================================================' - cat tests/shell/daemon_log_2 + cat "$TEST_ROOT/daemon_log_2" fail "daemon:log" E "Daemon run with non-empty log" fi -if ( test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xzsh" ) \ - && ( test "x${ONLY_TEST_TYPE}" = "x" || test "x${ONLY_TEST_TYPE}" = "xzpython" ) \ - && zsh tests/test_shells/zsh_test_script.zsh 2>/dev/null; then +if ( test -z "${ONLY_SHELL}" || test "${ONLY_SHELL}" = "zsh" ) \ + && ( test -z "${ONLY_TEST_TYPE}" || test "${ONLY_TEST_TYPE}" = "zpython" ) \ + && "$TEST_ROOT/path/zsh" "$ROOT/tests/test_shells/zsh_test_script.zsh" +then echo "> zpython" if ! run_test zpython zpython zsh -f -i ; then fail "zsh-zpython:test" F "Failed checking zsh -f -i" fi fi -if test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xpdb" ; then +if test -z "${ONLY_SHELL}" || test "${ONLY_SHELL}" = "pdb" ; then if test "$PYTHON_IMPLEMENTATION" != "PyPy" ; then - if test "x${ONLY_TEST_TYPE}" = "x" || test "x${ONLY_TEST_TYPE}" = "xsubclass" ; then + if test -z "${ONLY_TEST_TYPE}" || test "${ONLY_TEST_TYPE}" = "subclass" + then echo "> pdb subclass" - if ! run_test subclass python $PDB_PYTHON "$PWD/tests/test_shells/pdb-main.py" ; then - fail "pdb-subclass:test" F "Failed checking $PDB_PYTHON $PWD/tests/test_shells/pdb-main.py" + if ! run_test subclass python $PDB_PYTHON \ + "$ROOT/tests/test_shells/pdb-main.py" + then + fail "pdb-subclass:test" F \ + "Failed checking $PDB_PYTHON $ROOT/tests/test_shells/pdb-main.py" fi fi - if test "x${ONLY_TEST_TYPE}" = "x" || test "x${ONLY_TEST_TYPE}" = "xmodule" ; then + if test -z "${ONLY_TEST_TYPE}" || test "${ONLY_TEST_TYPE}" = "module" ; then echo "> pdb module" MODULE="powerline.bindings.pdb" if test "$PYTHON_MM" = "2.6" ; then MODULE="powerline.bindings.pdb.__main__" fi - if ! run_test module python $PDB_PYTHON -m$MODULE "$PWD/tests/test_shells/pdb-script.py" ; then - fail "pdb-module:test" F "Failed checking $PDB_PYTHON -m$MODULE $PWD/tests/test_shells/pdb-script" + if ! run_test module python "$PDB_PYTHON" -m"$MODULE" \ + "$ROOT/tests/test_shells/pdb-script.py" + then + fail "pdb-module:test" F \ + "Failed checking $PDB_PYTHON -m$MODULE $ROOT/tests/test_shells/pdb-script" fi fi fi fi -if test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xipython" ; then +if test -z "${ONLY_SHELL}" || test "${ONLY_SHELL}" = "ipython" ; then if "${PYTHON}" -c "try: import IPython${NL}except ImportError: raise SystemExit(1)" ; then # Define some overrides which should be ignored by IPython. export POWERLINE_CONFIG_OVERRIDES='common.term_escape_style=fbterm' @@ -454,8 +482,4 @@ if test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xipython" ; then fi fi -if test $FAILED -eq 0 ; then - rm -r tests/shell -fi - exit_suite diff --git a/tests/test_shells/zsh.daemon.ok b/tests/test_shells/zsh.daemon.ok index bea39b96..32e80d8d 100644 --- a/tests/test_shells/zsh.daemon.ok +++ b/tests/test_shells/zsh.daemon.ok @@ -1,14 +1,14 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh [1] PID -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s [1] + terminated bgscript.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd "$DIR1" +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd "$DIR1"   HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%' @@ -18,35 +18,35 @@   HOSTNAME  USER   BRANCH  …  shell  3rd  $(echo)  cd ../'`echo`'   HOSTNAME  USER   BRANCH  …  shell  3rd  `echo`  cd ../'«Unicode!»'   HOSTNAME  USER   BRANCH  …  shell  3rd  «Unicode!»  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bindkey -v ; set_theme default - INSERT   HOSTNAME  USER  …  tests  shell  3rd   COMMND   HOSTNAME  USER  …  tests  shell  3rd   - INSERT   HOSTNAME  USER  …  tests  shell  3rd   - INSERT   HOSTNAME  USER  …  tests  shell  3rd  echo abc +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bindkey -v ; set_theme default + INSERT   HOSTNAME  USER  …  tmp  shell  3rd   COMMND   HOSTNAME  USER  …  tmp  shell  3rd   + INSERT   HOSTNAME  USER  …  tmp  shell  3rd   + INSERT   HOSTNAME  USER  …  tmp  shell  3rd  echo abc abc - INSERT   HOSTNAME  USER  …  tests  shell  3rd  false - INSERT   HOSTNAME  USER  …  tests  shell  3rd  set_theme_option default.segment_data.hostname.display false - INSERT  USER  …  tests  shell  3rd  set_theme_option default.segment_data.user.display false - INSERT  …  tests  shell  3rd  select abc in def ghi jkl - select                            do - select                             echo $abc - select                             break - select                            done + INSERT   HOSTNAME  USER  …  tmp  shell  3rd  false + INSERT   HOSTNAME  USER  …  tmp  shell  3rd  set_theme_option default.segment_data.hostname.display false + INSERT  USER  …  tmp  shell  3rd  set_theme_option default.segment_data.user.display false + INSERT  …  tmp  shell  3rd  select abc in def ghi jkl + select                          do + select                           echo $abc + select                           break + select                          done 1) def 2) ghi 3) jkl -                   Select variant  1 +                 Select variant  1 def - INSERT  …  tests  shell  3rd  cd . - INSERT  …  tests  shell  3rd  cd . - INSERT  …  tests  shell  3rd  set_theme_option default.segments.above "$ABOVE_LEFT" - INSERT  …  tests  shell  3rd  export DISPLAYED_ENV_VAR=foo + INSERT  …  tmp  shell  3rd  cd . + INSERT  …  tmp  shell  3rd  cd . + INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above "$ABOVE_LEFT" + INSERT  …  tmp  shell  3rd  export DISPLAYED_ENV_VAR=foo  foo   - INSERT  …  tests  shell  3rd  unset DISPLAYED_ENV_VAR - INSERT  …  tests  shell  3rd  set_theme_option default.segments.above "$ABOVE_FULL" + INSERT  …  tmp  shell  3rd  unset DISPLAYED_ENV_VAR + INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above "$ABOVE_FULL"                                                                                                                                                                                                                                                                                                             - INSERT  …  tests  shell  3rd  export DISPLAYED_ENV_VAR=foo + INSERT  …  tmp  shell  3rd  export DISPLAYED_ENV_VAR=foo                                                                                                                                                                                                                                                                                                       foo  - INSERT  …  tests  shell  3rd  unset DISPLAYED_ENV_VAR + INSERT  …  tmp  shell  3rd  unset DISPLAYED_ENV_VAR                                                                                                                                                                                                                                                                                                             - INSERT  …  tests  shell  3rd  set_theme_option default.segments.above - INSERT  …  tests  shell  3rd  hash -d foo=$PWD:h ; cd . + INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above + INSERT  …  tmp  shell  3rd  hash -d foo=$PWD:h ; cd .  INSERT  ~foo  3rd  set_theme_option default.dividers.left.hard \$ABC  INSERT $ABC~foo  3rd $ABCtrue diff --git a/tests/test_shells/zsh.nodaemon.ok b/tests/test_shells/zsh.nodaemon.ok index d6f4d518..3aa285f8 100644 --- a/tests/test_shells/zsh.nodaemon.ok +++ b/tests/test_shells/zsh.nodaemon.ok @@ -1,14 +1,14 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git   HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh [1] PID -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s [1] + terminated bgscript.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd "$DIR1" +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd "$DIR1"   HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%' @@ -18,15 +18,15 @@   HOSTNAME  USER   BRANCH  …  shell  3rd  $(echo)  cd ../'`echo`'   HOSTNAME  USER   BRANCH  …  shell  3rd  `echo`  cd ../'«Unicode!»'   HOSTNAME  USER   BRANCH  …  shell  3rd  «Unicode!»  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bindkey -v ; set_theme default - INSERT   HOSTNAME  USER  …  tests  shell  3rd   COMMND   HOSTNAME  USER  …  tests  shell  3rd   - INSERT   HOSTNAME  USER  …  tests  shell  3rd   - INSERT   HOSTNAME  USER  …  tests  shell  3rd  echo abc +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bindkey -v ; set_theme default + INSERT   HOSTNAME  USER  …  tmp  shell  3rd   COMMND   HOSTNAME  USER  …  tmp  shell  3rd   + INSERT   HOSTNAME  USER  …  tmp  shell  3rd   + INSERT   HOSTNAME  USER  …  tmp  shell  3rd  echo abc abc - INSERT   HOSTNAME  USER  …  tests  shell  3rd  false - INSERT   HOSTNAME  USER  …  tests  shell  3rd  set_theme_option default.segment_data.hostname.display false - INSERT  USER  …  tests  shell  3rd  set_theme_option default.segment_data.user.display false - INSERT  …  tests  shell  3rd  select abc in def ghi jkl + INSERT   HOSTNAME  USER  …  tmp  shell  3rd  false + INSERT   HOSTNAME  USER  …  tmp  shell  3rd  set_theme_option default.segment_data.hostname.display false + INSERT  USER  …  tmp  shell  3rd  set_theme_option default.segment_data.user.display false + INSERT  …  tmp  shell  3rd  select abc in def ghi jkl  select  do  select   echo $abc  select   break @@ -34,19 +34,19 @@ abc 1) def 2) ghi 3) jkl  Select variant  1 def - INSERT  …  tests  shell  3rd  cd . - INSERT  …  tests  shell  3rd  cd . - INSERT  …  tests  shell  3rd  set_theme_option default.segments.above "$ABOVE_LEFT" - INSERT  …  tests  shell  3rd  export DISPLAYED_ENV_VAR=foo + INSERT  …  tmp  shell  3rd  cd . + INSERT  …  tmp  shell  3rd  cd . + INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above "$ABOVE_LEFT" + INSERT  …  tmp  shell  3rd  export DISPLAYED_ENV_VAR=foo  foo   - INSERT  …  tests  shell  3rd  unset DISPLAYED_ENV_VAR - INSERT  …  tests  shell  3rd  set_theme_option default.segments.above "$ABOVE_FULL" + INSERT  …  tmp  shell  3rd  unset DISPLAYED_ENV_VAR + INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above "$ABOVE_FULL"                                                                                                                                                                                                                                                                                                             - INSERT  …  tests  shell  3rd  export DISPLAYED_ENV_VAR=foo + INSERT  …  tmp  shell  3rd  export DISPLAYED_ENV_VAR=foo                                                                                                                                                                                                                                                                                                       foo  - INSERT  …  tests  shell  3rd  unset DISPLAYED_ENV_VAR + INSERT  …  tmp  shell  3rd  unset DISPLAYED_ENV_VAR                                                                                                                                                                                                                                                                                                             - INSERT  …  tests  shell  3rd  set_theme_option default.segments.above - INSERT  …  tests  shell  3rd  hash -d foo=$PWD:h ; cd . + INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above + INSERT  …  tmp  shell  3rd  hash -d foo=$PWD:h ; cd .  INSERT  ~foo  3rd  set_theme_option default.dividers.left.hard \$ABC  INSERT $ABC~foo  3rd $ABCtrue diff --git a/tests/test_shells/zsh.zpython.ok b/tests/test_shells/zsh.zpython.ok index b19cf390..32e80d8d 100644 --- a/tests/test_shells/zsh.zpython.ok +++ b/tests/test_shells/zsh.zpython.ok @@ -1,41 +1,52 @@ -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd .git -  HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment" -  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV= -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd .git +  HOSTNAME  USER   BRANCH  …  shell  3rd  .git  cd .. +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment" +  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV= +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh [1] PID -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s [1] + terminated bgscript.sh -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  cd "$DIR1" -  HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2" -  HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]' -  HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%' -  HOSTNAME  USER   BRANCH  …  shell  3rd  %%  cd ../'#[bold]' -  HOSTNAME  USER   BRANCH  …  shell  3rd  #[bold]  cd ../'(echo)' -  HOSTNAME  USER   BRANCH  …  shell  3rd  (echo)  cd ../'$(echo)' -  HOSTNAME  USER   BRANCH  …  shell  3rd  $(echo)  cd ../'`echo`' -  HOSTNAME  USER   BRANCH  …  shell  3rd  `echo`  cd ../'«Unicode!»' -  HOSTNAME  USER   BRANCH  …  shell  3rd  «Unicode!»  cd .. -  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bindkey -v ; set_theme default - INSERT   HOSTNAME  USER  …  tests  shell  3rd   COMMND   HOSTNAME  USER  …  tests  shell  3rd   - INSERT   HOSTNAME  USER  …  tests  shell  3rd   - INSERT   HOSTNAME  USER  …  tests  shell  3rd  echo abc +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  cd "$DIR1" +  HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2" +  HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]' +  HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%' +  HOSTNAME  USER   BRANCH  …  shell  3rd  %%  cd ../'#[bold]' +  HOSTNAME  USER   BRANCH  …  shell  3rd  #[bold]  cd ../'(echo)' +  HOSTNAME  USER   BRANCH  …  shell  3rd  (echo)  cd ../'$(echo)' +  HOSTNAME  USER   BRANCH  …  shell  3rd  $(echo)  cd ../'`echo`' +  HOSTNAME  USER   BRANCH  …  shell  3rd  `echo`  cd ../'«Unicode!»' +  HOSTNAME  USER   BRANCH  …  shell  3rd  «Unicode!»  cd .. +  HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bindkey -v ; set_theme default + INSERT   HOSTNAME  USER  …  tmp  shell  3rd   COMMND   HOSTNAME  USER  …  tmp  shell  3rd   + INSERT   HOSTNAME  USER  …  tmp  shell  3rd   + INSERT   HOSTNAME  USER  …  tmp  shell  3rd  echo abc abc - INSERT   HOSTNAME  USER  …  tests  shell  3rd  false - INSERT   HOSTNAME  USER  …  tests  shell  3rd  set_theme_option default.segment_data.hostname.display false - INSERT  USER  …  tests  shell  3rd  set_theme_option default.segment_data.user.display false - INSERT  …  tests  shell  3rd  select abc in def ghi jkl - select                            do - select                             echo $abc - select                             break - select                            done + INSERT   HOSTNAME  USER  …  tmp  shell  3rd  false + INSERT   HOSTNAME  USER  …  tmp  shell  3rd  set_theme_option default.segment_data.hostname.display false + INSERT  USER  …  tmp  shell  3rd  set_theme_option default.segment_data.user.display false + INSERT  …  tmp  shell  3rd  select abc in def ghi jkl + select                          do + select                           echo $abc + select                           break + select                          done 1) def 2) ghi 3) jkl -                   Select variant  1 +                 Select variant  1 def - INSERT  …  tests  shell  3rd  cd . - INSERT  …  tests  shell  3rd  cd . - INSERT  …  tests  shell  3rd  hash -d foo=$PWD:h ; cd . - INSERT  ~foo  3rd  set_theme_option default.dividers.left.hard \$ABC - INSERT $ABC~foo  3rd $ABCtrue + INSERT  …  tmp  shell  3rd  cd . + INSERT  …  tmp  shell  3rd  cd . + INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above "$ABOVE_LEFT" + INSERT  …  tmp  shell  3rd  export DISPLAYED_ENV_VAR=foo + foo   + INSERT  …  tmp  shell  3rd  unset DISPLAYED_ENV_VAR + INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above "$ABOVE_FULL" +                                                                                                                                                                                                                                                                                                            + INSERT  …  tmp  shell  3rd  export DISPLAYED_ENV_VAR=foo +                                                                                                                                                                                                                                                                                                      foo  + INSERT  …  tmp  shell  3rd  unset DISPLAYED_ENV_VAR +                                                                                                                                                                                                                                                                                                            + INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above + INSERT  …  tmp  shell  3rd  hash -d foo=$PWD:h ; cd . + INSERT  ~foo  3rd  set_theme_option default.dividers.left.hard \$ABC + INSERT $ABC~foo  3rd $ABCtrue diff --git a/tests/test_shells/zsh_test_script.zsh b/tests/test_shells/zsh_test_script.zsh index f4b894ce..3957f567 100644 --- a/tests/test_shells/zsh_test_script.zsh +++ b/tests/test_shells/zsh_test_script.zsh @@ -1,6 +1,8 @@ set -e +set -x . tests/bot-ci/scripts/common/main.sh -zmodload zpython +zmodload zpython || zmodload libzpython +zpython 'import zsh' zpython 'import platform' zpython 'zsh.setvalue("ZSH_PYTHON_VERSION", platform.python_version())' zpython 'zsh.setvalue("ZSH_PYTHON_IMPLEMENTATION", platform.python_implementation())'