Refactor shells test code

Tests passing locally:

bash (no)daemon C
busybox (no)daemon C
fish (no)daemon C
mksh (no)daemon C
rc (no)daemon C
tcsh (no)daemon C
zsh (no)daemon C
zsh zpython
ipython
pdf module
pdf subclass

dash has problems with job control (bgscript.sh not finished by kill)
This commit is contained in:
Foo 2017-05-01 00:00:45 +03:00
parent 717ae5e428
commit 5a3e19847e
28 changed files with 378 additions and 338 deletions

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
[1] PID [1] PID
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1]+ Terminated bgscript.sh [1]+ Terminated bgscript.sh
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false   HOSTNAME  USER   BRANCH  …  tmp  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  USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  …  tests  shell  3rd  echo '   BRANCH  …  tmp  shell  3rd  echo '
                                     abc                                    abc
                                     def                                    def
                                     '                                    '
abc abc
def def
  BRANCH  …  tests  shell  3rd  cd "$DIR1"   BRANCH  …  tmp  shell  3rd  cd "$DIR1"
  BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"
  BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  BRANCH  …  shell  3rd  \[\]  cd ../'%%'   BRANCH  …  shell  3rd  \[\]  cd ../'%%'

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
[1] PID [1] PID
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1]+ Terminated bgscript.sh [1]+ Terminated bgscript.sh
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false   HOSTNAME  USER   BRANCH  …  tmp  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  USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  …  tests  shell  3rd  echo '   BRANCH  …  tmp  shell  3rd  echo '
   abc    abc
   def    def
   '    '
@ -17,7 +17,7 @@
abc abc
def def
  BRANCH  …  tests  shell  3rd  cd "$DIR1"   BRANCH  …  tmp  shell  3rd  cd "$DIR1"
  BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"
  BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  BRANCH  …  shell  3rd  \[\]  cd ../'%%'   BRANCH  …  shell  3rd  \[\]  cd ../'%%'

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1]+ Terminated bgscript.sh [1]+ Terminated bgscript.sh
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  set_theme_option default_leftonly.segment_data.hostname.display false   HOSTNAME  USER   BRANCH  …  tmp  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  USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  …  tests  shell  3rd  echo '   BRANCH  …  tmp  shell  3rd  echo '
                                     abc                                    abc
                                     def                                    def
                                     '                                    '
abc abc
def def
  BRANCH  …  tests  shell  3rd  cd "$DIR1"   BRANCH  …  tmp  shell  3rd  cd "$DIR1"
  BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"
  BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  BRANCH  …  shell  3rd  \[\]  cd ../'%%'   BRANCH  …  shell  3rd  \[\]  cd ../'%%'

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1]+ Terminated bgscript.sh [1]+ Terminated bgscript.sh
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  set_theme_option default_leftonly.segment_data.hostname.display false   HOSTNAME  USER   BRANCH  …  tmp  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  USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  …  tests  shell  3rd  echo '   BRANCH  …  tmp  shell  3rd  echo '
   abc    abc
   def    def
   '    '
@ -16,7 +16,7 @@
abc abc
def def
  BRANCH  …  tests  shell  3rd  cd "$DIR1"   BRANCH  …  tmp  shell  3rd  cd "$DIR1"
  BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"
  BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  BRANCH  …  shell  3rd  \[\]  cd ../'%%'   BRANCH  …  shell  3rd  \[\]  cd ../'%%'

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s
set_theme_option default_leftonly.segment_data.hostname.display false 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   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1   USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  …  tests  shell  3rd  echo '   BRANCH  …  tmp  shell  3rd  echo '
                                     abc                                    abc
                                     def                                    def
                                     '                                    '
abc abc
def def
  BRANCH  …  tests  shell  3rd  cd "$DIR1"   BRANCH  …  tmp  shell  3rd  cd "$DIR1"
  BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"
  BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  BRANCH  …  shell  3rd  \[\]  cd ../'%%'   BRANCH  …  shell  3rd  \[\]  cd ../'%%'

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s
set_theme_option default_leftonly.segment_data.hostname.display false 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   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1   USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  …  tests  shell  3rd  echo '   BRANCH  …  tmp  shell  3rd  echo '
   abc    abc
   def    def
   '    '
@ -15,7 +15,7 @@ set_theme_option default_leftonly.segment_data.hostname.display false
abc abc
def def
  BRANCH  …  tests  shell  3rd  cd "$DIR1"   BRANCH  …  tmp  shell  3rd  cd "$DIR1"
  BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"
  BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  BRANCH  …  shell  3rd  \[\]  cd ../'%%'   BRANCH  …  shell  3rd  \[\]  cd ../'%%'

View File

@ -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  …  shell  3rd  .git  
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd     HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd     HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd     HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1     HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1     HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd     HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  
  HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m     HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m  
  HOSTNAME  USER   BRANCH  …  shell  3rd  ^H     HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  
  HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]     HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  

View File

@ -32,7 +32,7 @@ ABOVE_FULL='[{
set_theme default_leftonly set_theme default_leftonly
export VIRTUAL_ENV= export VIRTUAL_ENV=
source powerline/bindings/bash/powerline.sh source powerline/bindings/bash/powerline.sh
cd tests/shell/3rd cd "$TEST_ROOT"/3rd
cd .git cd .git
cd .. cd ..
VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"

View File

@ -8,7 +8,7 @@ set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false
set_theme default_leftonly set_theme default_leftonly
. powerline/bindings/shell/powerline.sh . powerline/bindings/shell/powerline.sh
export VIRTUAL_ENV= export VIRTUAL_ENV=
cd tests/shell/3rd cd "$TEST_ROOT"/3rd
cd .git cd .git
cd .. cd ..
VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"

View File

@ -8,7 +8,7 @@ set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false
set_theme default_leftonly set_theme default_leftonly
. powerline/bindings/shell/powerline.sh . powerline/bindings/shell/powerline.sh
export VIRTUAL_ENV= export VIRTUAL_ENV=
cd tests/shell/3rd cd "$TEST_ROOT"/3rd
cd .git cd .git
cd .. cd ..
VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"

View File

@ -37,7 +37,7 @@ while jobs | grep fish_update_completions
end end
powerline-setup powerline-setup
setenv VIRTUAL_ENV setenv VIRTUAL_ENV
cd tests/shell/3rd cd "$TEST_ROOT"/3rd
cd .git cd .git
cd .. cd ..
setenv VIRTUAL_ENV "$HOME/.virtenvs/some-virtual-environment" setenv VIRTUAL_ENV "$HOME/.virtenvs/some-virtual-environment"

View File

@ -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 42
bool 44 bool 44
class Test(object): class Test(object):

View File

@ -8,7 +8,7 @@ set_theme default_leftonly
set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false set_theme_option default_leftonly.segment_data.hostname.args.only_if_ssh false
. powerline/bindings/shell/powerline.sh . powerline/bindings/shell/powerline.sh
export VIRTUAL_ENV= export VIRTUAL_ENV=
cd tests/shell/3rd cd "$TEST_ROOT"/3rd
cd .git cd .git
cd .. cd ..
VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment" VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"

View File

@ -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_CONFIG_OVERRIDES = 'ext.shell.theme=default_leftonly'
. powerline/bindings/rc/powerline.rc . powerline/bindings/rc/powerline.rc
VIRTUAL_ENV = () VIRTUAL_ENV = ()
cd tests/shell/3rd cd $TEST_ROOT/3rd
true cd "$TEST_ROOT"/3rd # Test start marker
cd .git cd .git
cd .. cd ..
VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment' VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment'

View File

@ -2,7 +2,7 @@ setenv POWERLINE_THEME_OVERRIDES "default_leftonly.segment_data.hostname.args.on
setenv POWERLINE_CONFIG_OVERRIDES "ext.shell.theme=default_leftonly" setenv POWERLINE_CONFIG_OVERRIDES "ext.shell.theme=default_leftonly"
source powerline/bindings/tcsh/powerline.tcsh source powerline/bindings/tcsh/powerline.tcsh
unsetenv VIRTUAL_ENV unsetenv VIRTUAL_ENV
cd tests/shell/3rd cd "$TEST_ROOT"/3rd
cd .git cd .git
cd .. cd ..
setenv VIRTUAL_ENV "/home/foo/.virtenvs/some-virtual-environment" setenv VIRTUAL_ENV "/home/foo/.virtenvs/some-virtual-environment"

View File

@ -43,7 +43,7 @@ ABOVE_FULL='[{
}]' }]'
set_theme default_leftonly set_theme default_leftonly
export VIRTUAL_ENV= export VIRTUAL_ENV=
cd tests/shell/3rd cd "$TEST_ROOT"/3rd
cd .git cd .git
cd .. cd ..
VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment" VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment"

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
[1] PID [1] PID
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1
[1] + Terminated bash -c ... [1] + Terminated bash -c ...
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false   HOSTNAME  USER   BRANCH  …  tmp  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  USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  …  tests  shell  3rd  echo -n   BRANCH  …  tmp  shell  3rd  echo -n
  BRANCH  …  tests  shell  3rd  echo '   BRANCH  …  tmp  shell  3rd  echo '
                                     abc                                    abc
                                     def                                    def
                                     '                                    '
abc abc
def def
  BRANCH  …  tests  shell  3rd  cd "$DIR1"   BRANCH  …  tmp  shell  3rd  cd "$DIR1"
  BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"
  BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  BRANCH  …  shell  3rd  \[\]  cd ../'%%'   BRANCH  …  shell  3rd  \[\]  cd ../'%%'

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
[1] PID [1] PID
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1
[1] + Terminated bash -c ... [1] + Terminated bash -c ...
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  set_theme_option default_leftonly.segment_data.hostname.display false   HOSTNAME  USER   BRANCH  …  tmp  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  USER   BRANCH  …  tmp  shell  3rd  set_theme_option default_leftonly.segment_data.user.display false
  BRANCH  …  tests  shell  3rd  echo -n   BRANCH  …  tmp  shell  3rd  echo -n
  BRANCH  …  tests  shell  3rd  echo '   BRANCH  …  tmp  shell  3rd  echo '
   abc    abc
   def    def
   '    '
@ -19,7 +19,7 @@
abc abc
def def
  BRANCH  …  tests  shell  3rd  cd "$DIR1"   BRANCH  …  tmp  shell  3rd  cd "$DIR1"
  BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"   BRANCH  …  shell  3rd  ^[[32m  cd ../"$DIR2"
  BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  BRANCH  …  shell  3rd  \[\]  cd ../'%%'   BRANCH  …  shell  3rd  \[\]  cd ../'%%'

View File

@ -10,12 +10,13 @@ import platform
import re import re
test_root = os.environ['TEST_ROOT']
test_type = sys.argv[1] test_type = sys.argv[1]
test_client = sys.argv[2] test_client = sys.argv[2]
shell = sys.argv[3] shell = sys.argv[3]
fname = os.path.join('tests', 'shell', '.'.join((shell, test_type, test_client, 'full.log'))) fname = os.path.join(test_root, '.'.join((shell, test_type, test_client, 'full.log')))
new_fname = os.path.join('tests', 'shell', '.'.join((shell, test_type, test_client, 'log'))) new_fname = os.path.join(test_root, '.'.join((shell, test_type, test_client, 'log')))
pid_fname = os.path.join('tests', 'shell', '3rd', 'pid') pid_fname = os.path.join(test_root, '3rd', 'pid')
is_pypy = platform.python_implementation() == 'PyPy' 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])|[=>])') 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]') ZSH_HL_RE = re.compile(r'\033\[\?\d+[hl]')
start_str = 'cd tests/shell/3rd' start_str = 'cd "$TEST_ROOT"/3rd'
if shell == 'pdb': if shell == 'pdb':
start_str = 'class Foo(object):' start_str = 'class Foo(object):'

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment'   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment'
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV = ()   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV = ()
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
PID PID
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `{cat pid} ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `{cat pid} ; sleep 1s
  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  ^[[32m  cd ../$DIR2
  HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%'   HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%'

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment'   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV = '/home/foo/.virtenvs/some-virtual-environment'
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV = ()   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV = ()
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
PID PID
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `{cat pid} ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `{cat pid} ; sleep 1s
  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  ^[[32m  cd ../$DIR2
  HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%'   HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%'

View File

@ -25,6 +25,7 @@ def get_argparser(ArgumentParser=argparse.ArgumentParser):
def main(): def main():
test_root = os.environ['TEST_ROOT']
parser = get_argparser() parser = get_argparser()
args = parser.parse_args() args = parser.parse_args()
@ -33,11 +34,10 @@ def main():
test_client = args.client or test_type test_client = args.client or test_type
log_file_base = '{0}.{1}.{2}'.format(shell, test_type, test_client) 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)) full_log_file_name = os.path.join(test_root, '{0}.full.log'.format(log_file_base))
# postproc_log_file_name = os.path.join('tests', 'shell', '{0}.log'.format(log_file_base))
local_paths = [ local_paths = [
os.path.abspath(os.path.join('tests', 'shell', 'path')), os.path.abspath(os.path.join(test_root, 'path')),
os.path.abspath('scripts'), os.path.abspath('scripts'),
] ]
@ -55,8 +55,8 @@ def main():
'TERM': 'screen-256color', 'TERM': 'screen-256color',
'DIR1': os.environ['DIR1'], 'DIR1': os.environ['DIR1'],
'DIR2': os.environ['DIR2'], 'DIR2': os.environ['DIR2'],
'XDG_CONFIG_HOME': os.path.abspath(os.path.join('tests', 'shell', 'fish_home')), 'XDG_CONFIG_HOME': os.path.abspath(os.path.join(test_root, 'fish_home')),
'IPYTHONDIR': os.path.abspath(os.path.join('tests', 'shell', 'ipython_home')), 'IPYTHONDIR': os.path.abspath(os.path.join(test_root, 'ipython_home')),
'PYTHONPATH': python_paths, 'PYTHONPATH': python_paths,
'POWERLINE_CONFIG_OVERRIDES': os.environ.get('POWERLINE_CONFIG_OVERRIDES', ''), 'POWERLINE_CONFIG_OVERRIDES': os.environ.get('POWERLINE_CONFIG_OVERRIDES', ''),
'POWERLINE_THEME_OVERRIDES': os.environ.get('POWERLINE_THEME_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_ARGS': os.environ.get('POWERLINE_COMMAND_ARGS', ''),
'POWERLINE_COMMAND': os.environ.get('POWERLINE_COMMAND', ''), 'POWERLINE_COMMAND': os.environ.get('POWERLINE_COMMAND', ''),
'LD_LIBRARY_PATH': os.environ.get('LD_LIBRARY_PATH', ''), 'LD_LIBRARY_PATH': os.environ.get('LD_LIBRARY_PATH', ''),
'TEST_ROOT': test_root,
} }
os.environ['PATH'] = environ['PATH'] os.environ['PATH'] = environ['PATH']
@ -111,11 +112,11 @@ def main():
child.close(force=True) child.close(force=True)
check_call([ check_call([
os.path.join('tests', 'shell', 'path', 'python'), os.path.join(test_root, 'path', 'python'),
os.path.join('tests', 'test_shells', 'postproc.py'), os.path.join('tests', 'test_shells', 'postproc.py'),
test_type, test_client, shell 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): if os.path.exists(pidfile):
os.unlink(pidfile) os.unlink(pidfile)

View File

@ -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  …  shell  3rd  .git  
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd     HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd     HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd     HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd     HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1     HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd     HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  
  HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m     HOSTNAME  USER   BRANCH  …  shell  3rd  ^[[32m  
  HOSTNAME  USER   BRANCH  …  shell  3rd  ^H     HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  
  HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]     HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
. tests/shlib/common.sh . tests/shlib/common.sh
enter_suite shells enter_suite shell
if test $# -eq 0 ; then if test $# -eq 0 ; then
FAST=1 FAST=1
@ -28,14 +28,14 @@ check_screen_log() {
TEST_TYPE="$1" TEST_TYPE="$1"
TEST_CLIENT="$2" TEST_CLIENT="$2"
SH="$3" SH="$3"
if test -e tests/test_shells/${SH}.${TEST_TYPE}.ok ; then if test -e "$ROOT/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 diff -a -u "$ROOT/tests/test_shells/${SH}.${TEST_TYPE}.ok" "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log"
return $? return $?
elif test -e tests/test_shells/${SH}.ok ; then elif test -e "$ROOT/tests/test_shells/${SH}.ok" ; then
diff -a -u tests/test_shells/${SH}.ok tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log diff -a -u "$ROOT/tests/test_shells/${SH}.ok" "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log"
return $? return $?
else else
cat tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log cat "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log"
return 1 return 1
fi fi
} }
@ -50,13 +50,13 @@ print_full_output() {
SH="$3" SH="$3"
echo "Full output:" echo "Full output:"
echo '============================================================' echo '============================================================'
cat tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log cat "$TEST_ROOT/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log"
echo echo
echo '____________________________________________________________' echo '____________________________________________________________'
if test "x$POWERLINE_TEST_NO_CAT_V" != "x1" ; then if test "x$POWERLINE_TEST_NO_CAT_V" != "x1" ; then
echo "Full output (cat -v):" echo "Full output (cat -v):"
echo '============================================================' 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
echo '____________________________________________________________' echo '____________________________________________________________'
fi fi
@ -104,9 +104,9 @@ do_run_test() {
fi fi
echo -n "Failed ${SH}. " echo -n "Failed ${SH}. "
print_full_output ${TEST_TYPE} ${TEST_CLIENT} ${SH} print_full_output ${TEST_TYPE} ${TEST_CLIENT} ${SH}
case ${SH} in case "${SH}" in
*ksh) *ksh)
${SH} -c 'echo ${KSH_VERSION}' "$TEST_ROOT/path/${SH}" -c 'echo ${KSH_VERSION}'
;; ;;
dash) dash)
# ? # ?
@ -115,7 +115,7 @@ do_run_test() {
busybox --help busybox --help
;; ;;
*) *)
${SH} --version "$TEST_ROOT/path/${SH}" --version
;; ;;
esac esac
if which dpkg >/dev/null ; then if which dpkg >/dev/null ; then
@ -135,82 +135,82 @@ run_test() {
attempts=1 attempts=1
fi fi
while test $attempts -gt 0 ; do while test $attempts -gt 0 ; do
rm -f tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.log rm -f "$TEST_ROOT/${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}.full.log"
do_run_test "$@" && return 0 do_run_test "$@" && return 0
attempts=$(( attempts - 1 )) attempts=$(( attempts - 1 ))
done done
return 1 return 1
} }
test -d tests/shell && rm -r tests/shell make_test_root
mkdir tests/shell
git init tests/shell/3rd git init "$TEST_ROOT/3rd"
git --git-dir=tests/shell/3rd/.git checkout -b BRANCH git --git-dir="$TEST_ROOT/3rd/.git" checkout -b BRANCH
export DIR1="" export DIR1=""
export DIR2="" export DIR2=""
mkdir tests/shell/3rd/"$DIR1" mkdir "$TEST_ROOT/3rd/$DIR1"
mkdir tests/shell/3rd/"$DIR2" mkdir "$TEST_ROOT/3rd/$DIR2"
mkdir tests/shell/3rd/'\[\]' mkdir "$TEST_ROOT"/3rd/'\[\]'
mkdir tests/shell/3rd/'%%' mkdir "$TEST_ROOT"/3rd/'%%'
mkdir tests/shell/3rd/'#[bold]' mkdir "$TEST_ROOT"/3rd/'#[bold]'
mkdir tests/shell/3rd/'(echo)' mkdir "$TEST_ROOT"/3rd/'(echo)'
mkdir tests/shell/3rd/'$(echo)' mkdir "$TEST_ROOT"/3rd/'$(echo)'
mkdir tests/shell/3rd/'`echo`' mkdir "$TEST_ROOT"/3rd/'`echo`'
mkdir tests/shell/3rd/'«Unicode!»' mkdir "$TEST_ROOT"/3rd/'«Unicode!»'
mkdir tests/shell/fish_home mkdir "$TEST_ROOT/fish_home"
mkdir tests/shell/fish_home/fish mkdir "$TEST_ROOT/fish_home/fish"
mkdir tests/shell/fish_home/fish/generated_completions mkdir "$TEST_ROOT/fish_home/fish/generated_completions"
cp -r tests/test_shells/ipython_home tests/shell cp -r "$ROOT/tests/test_shells/ipython_home" "$TEST_ROOT"
mkdir tests/shell/path mkdir "$TEST_ROOT/path"
ln -s "$(which "${PYTHON}")" tests/shell/path/python ln -s "$(which "${PYTHON}")" "$TEST_ROOT/path/python"
ln -s "$(which env)" tests/shell/path ln -s "$(which env)" "$TEST_ROOT/path"
ln -s "$(which git)" tests/shell/path ln -s "$(which git)" "$TEST_ROOT/path"
ln -s "$(which sleep)" tests/shell/path ln -s "$(which sleep)" "$TEST_ROOT/path"
ln -s "$(which cat)" tests/shell/path ln -s "$(which cat)" "$TEST_ROOT/path"
ln -s "$(which false)" tests/shell/path ln -s "$(which false)" "$TEST_ROOT/path"
ln -s "$(which true)" tests/shell/path ln -s "$(which true)" "$TEST_ROOT/path"
ln -s "$(which kill)" tests/shell/path ln -s "$(which kill)" "$TEST_ROOT/path"
ln -s "$(which echo)" tests/shell/path ln -s "$(which echo)" "$TEST_ROOT/path"
ln -s "$(which which)" tests/shell/path ln -s "$(which which)" "$TEST_ROOT/path"
ln -s "$(which dirname)" tests/shell/path ln -s "$(which dirname)" "$TEST_ROOT/path"
ln -s "$(which wc)" tests/shell/path ln -s "$(which wc)" "$TEST_ROOT/path"
ln -s "$(which stty)" tests/shell/path ln -s "$(which stty)" "$TEST_ROOT/path"
ln -s "$(which cut)" tests/shell/path ln -s "$(which cut)" "$TEST_ROOT/path"
ln -s "$(which bc)" tests/shell/path ln -s "$(which bc)" "$TEST_ROOT/path"
ln -s "$(which expr)" tests/shell/path ln -s "$(which expr)" "$TEST_ROOT/path"
ln -s "$(which mktemp)" tests/shell/path ln -s "$(which mktemp)" "$TEST_ROOT/path"
ln -s "$(which grep)" tests/shell/path ln -s "$(which grep)" "$TEST_ROOT/path"
ln -s "$(which sed)" tests/shell/path ln -s "$(which sed)" "$TEST_ROOT/path"
ln -s "$(which rm)" tests/shell/path ln -s "$(which rm)" "$TEST_ROOT/path"
ln -s "$(which tr)" tests/shell/path ln -s "$(which tr)" "$TEST_ROOT/path"
ln -s "$(which uname)" tests/shell/path ln -s "$(which uname)" "$TEST_ROOT/path"
ln -s "$(which test)" tests/shell/path ln -s "$(which test)" "$TEST_ROOT/path"
ln -s "$(which pwd)" tests/shell/path ln -s "$(which pwd)" "$TEST_ROOT/path"
ln -s "$(which hostname)" tests/shell/path ln -s "$(which hostname)" "$TEST_ROOT/path"
ln -s ../../test_shells/bgscript.sh tests/shell/path ln -s "$ROOT/tests/test_shells/bgscript.sh" "$TEST_ROOT/path"
ln -s ../../test_shells/waitpid.sh tests/shell/path ln -s "$ROOT/tests/test_shells/waitpid.sh" "$TEST_ROOT/path"
if which socat ; then if which socat ; then
ln -s "$(which socat)" tests/shell/path ln -s "$(which socat)" "$TEST_ROOT/path"
fi fi
for pexe in powerline powerline-config powerline-render powerline.sh powerline.py ; do for pexe in powerline powerline-config powerline-render powerline.sh powerline.py ; do
if test -e scripts/$pexe ; then if test -e "$ROOT/scripts/$pexe" ; then
ln -s "$PWD/scripts/$pexe" tests/shell/path ln -s "$ROOT/scripts/$pexe" "$TEST_ROOT/path"
elif test -e client/$pexe ; then 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 elif which $pexe ; then
ln -s "$(which $pexe)" tests/shell/path ln -s "$(which $pexe)" "$TEST_ROOT/path"
else else
echo "Executable $pexe was not found" echo "Executable $pexe was not found"
exit 1 exit 1
fi fi
done done
ln -s python tests/shell/path/pdb ln -s python "$TEST_ROOT/path/pdb"
PDB_PYTHON=pdb PDB_PYTHON=pdb
ln -s python tests/shell/path/ipython ln -s python "$TEST_ROOT/path/ipython"
IPYTHON_PYTHON=ipython IPYTHON_PYTHON=ipython
if test -z "$POWERLINE_RC_EXE" ; then if test -z "$POWERLINE_RC_EXE" ; then
@ -224,7 +224,7 @@ if test -z "$POWERLINE_RC_EXE" ; then
fi fi
if which "$POWERLINE_RC_EXE" >/dev/null ; then 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 fi
for exe in bash zsh busybox fish tcsh mksh dash ; do 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 fi
fi fi
ln -s "$(which $exe)" tests/shell/path ln -s "$(which $exe)" "$TEST_ROOT/path"
fi fi
done done
mkdir tests/shell/home mkdir "$TEST_ROOT/home"
export HOME="$PWD/tests/shell/home" export HOME="$TEST_ROOT/home"
unset ENV unset ENV
@ -272,7 +272,10 @@ echo "Powerline address: $ADDRESS"
check_test_client() { check_test_client() {
local executable="$1" local executable="$1"
local client_type="$2" 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 local expected_mime_type
case "$client_type" in case "$client_type" in
C) expected_mime_type="application/x-executable" ;; C) expected_mime_type="application/x-executable" ;;
@ -286,14 +289,20 @@ check_test_client() {
fi 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 scripts/powerline-config shell command
for TEST_TYPE in "daemon" "nodaemon" ; do 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 continue
fi fi
if test x$FAST = x1 ; then if test "$FAST" = 1 ; then
if test $TEST_TYPE = daemon ; then if test $TEST_TYPE = daemon ; then
VARIANTS=3 VARIANTS=3
else 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 if test $TEST_TYPE = daemon ; then
sh -c ' sh -c '
echo $$ > tests/shell/daemon_pid echo $$ > "$TEST_ROOT/daemon_pid"
exec $PYTHON ./scripts/powerline-daemon -s$ADDRESS -f >tests/shell/daemon_log 2>&1 exec "$PYTHON" ./scripts/powerline-daemon -s"$ADDRESS" -f >"$TEST_ROOT/daemon_log" 2>&1
' & ' &
fi fi
echo "> Testing $TEST_TYPE" echo "> Testing $TEST_TYPE"
@ -328,17 +337,24 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te
continue continue
fi fi
I="$(( I + 1 ))" 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 if which powerline >/dev/null ; then
POWERLINE_COMMAND=powerline POWERLINE_COMMAND=powerline
else else
continue continue
fi fi
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 continue
fi 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 continue
fi fi
export POWERLINE_COMMAND_ARGS="--socket $ADDRESS" 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" "rc -i -p"
do do
J="$(( J + 1 ))" J="$(( J + 1 ))"
if test x$FAST = x1 ; then if test "$FAST" = 1 ; then
if test $(( (I + J) % $VARIANTS )) -ne $EXETEST ; then if test $(( (I + J) % $VARIANTS )) -ne $EXETEST ; then
continue continue
fi fi
fi fi
SH="${TEST_COMMAND%% *}" 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 continue
fi fi
if ! test -x tests/shell/path/$SH ; then if ! test -x "$TEST_ROOT/path/$SH" ; then
continue continue
fi fi
echo ">>> $(readlink "tests/shell/path/$SH")" echo ">>> $(readlink "$TEST_ROOT/path/$SH")"
if ! run_test $TEST_TYPE $TEST_CLIENT $TEST_COMMAND ; then if ! run_test $TEST_TYPE $TEST_CLIENT $TEST_COMMAND ; then
ALLOW_FAILURE_ARG= ALLOW_FAILURE_ARG=
# dash tests are not stable, see #931 # 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 if test x$FAST$SH = x1dash || test x$FAST$SH = x1fish ; then
ALLOW_FAILURE_ARG="--allow-failure" ALLOW_FAILURE_ARG="--allow-failure"
fi 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 fi
done done
done done
if test $TEST_TYPE = daemon ; then if test $TEST_TYPE = daemon ; then
$PYTHON ./scripts/powerline-daemon -s$ADDRESS -k "$PYTHON" ./scripts/powerline-daemon -s"$ADDRESS" -k
wait $(cat tests/shell/daemon_pid) wait $(cat "$TEST_ROOT/daemon_pid")
if ! test -z "$(cat tests/shell/daemon_log)" ; then if ! test -z "$(cat "$TEST_ROOT/daemon_log")" ; then
echo '____________________________________________________________' echo '____________________________________________________________'
echo "Daemon log:" echo "Daemon log:"
echo '============================================================' echo '============================================================'
cat tests/shell/daemon_log cat "$TEST_ROOT/daemon_log"
fail "$SH-$TEST_TYPE-$TEST_CLIENT:log" E "Non-empty daemon log for ${TEST_COMMAND}" fail "$SH-$TEST_TYPE-$TEST_CLIENT:log" E \
"Non-empty daemon log for ${TEST_COMMAND}"
fi fi
fi fi
done done
fi 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 sleep 1
$PYTHON scripts/powerline-daemon -s$ADDRESS -k "$PYTHON" scripts/powerline-daemon -s"$ADDRESS" -k
else else
fail "daemon:run" F "Daemon exited with status $?" fail "daemon:run" F "Daemon exited with status $?"
fi fi
if ! test -z "$(cat tests/shell/daemon_log_2)" ; then if ! test -z "$(cat "$TEST_ROOT/daemon_log_2")" ; then
echo '____________________________________________________________' echo '____________________________________________________________'
echo "Daemon log (2nd):" echo "Daemon log (2nd):"
echo '============================================================' echo '============================================================'
cat tests/shell/daemon_log_2 cat "$TEST_ROOT/daemon_log_2"
fail "daemon:log" E "Daemon run with non-empty log" fail "daemon:log" E "Daemon run with non-empty log"
fi fi
if ( test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xzsh" ) \ if ( test -z "${ONLY_SHELL}" || test "${ONLY_SHELL}" = "zsh" ) \
&& ( test "x${ONLY_TEST_TYPE}" = "x" || test "x${ONLY_TEST_TYPE}" = "xzpython" ) \ && ( test -z "${ONLY_TEST_TYPE}" || test "${ONLY_TEST_TYPE}" = "zpython" ) \
&& zsh tests/test_shells/zsh_test_script.zsh 2>/dev/null; then && "$TEST_ROOT/path/zsh" "$ROOT/tests/test_shells/zsh_test_script.zsh"
then
echo "> zpython" echo "> zpython"
if ! run_test zpython zpython zsh -f -i ; then if ! run_test zpython zpython zsh -f -i ; then
fail "zsh-zpython:test" F "Failed checking zsh -f -i" fail "zsh-zpython:test" F "Failed checking zsh -f -i"
fi fi
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 "$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" echo "> pdb subclass"
if ! run_test subclass python $PDB_PYTHON "$PWD/tests/test_shells/pdb-main.py" ; then if ! run_test subclass python $PDB_PYTHON \
fail "pdb-subclass:test" F "Failed checking $PDB_PYTHON $PWD/tests/test_shells/pdb-main.py" "$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
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" echo "> pdb module"
MODULE="powerline.bindings.pdb" MODULE="powerline.bindings.pdb"
if test "$PYTHON_MM" = "2.6" ; then if test "$PYTHON_MM" = "2.6" ; then
MODULE="powerline.bindings.pdb.__main__" MODULE="powerline.bindings.pdb.__main__"
fi fi
if ! run_test module python $PDB_PYTHON -m$MODULE "$PWD/tests/test_shells/pdb-script.py" ; then if ! run_test module python "$PDB_PYTHON" -m"$MODULE" \
fail "pdb-module:test" F "Failed checking $PDB_PYTHON -m$MODULE $PWD/tests/test_shells/pdb-script" "$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
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 if "${PYTHON}" -c "try: import IPython${NL}except ImportError: raise SystemExit(1)" ; then
# Define some overrides which should be ignored by IPython. # Define some overrides which should be ignored by IPython.
export POWERLINE_CONFIG_OVERRIDES='common.term_escape_style=fbterm' 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
fi fi
if test $FAILED -eq 0 ; then
rm -r tests/shell
fi
exit_suite exit_suite

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
[1] PID [1] PID
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1] + terminated bgscript.sh [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  ^[[32m  cd ../"$DIR2"
  HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  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 ../'`echo`'
  HOSTNAME  USER   BRANCH  …  shell  3rd  `echo`  cd ../'«Unicode!»'   HOSTNAME  USER   BRANCH  …  shell  3rd  `echo`  cd ../'«Unicode!»'
  HOSTNAME  USER   BRANCH  …  shell  3rd  «Unicode!»  cd ..   HOSTNAME  USER   BRANCH  …  shell  3rd  «Unicode!»  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bindkey -v ; set_theme default   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bindkey -v ; set_theme default
 INSERT   HOSTNAME  USER  …  tests  shell  3rd   COMMND   HOSTNAME  USER  …  tests  shell  3rd    INSERT   HOSTNAME  USER  …  tmp  shell  3rd   COMMND   HOSTNAME  USER  …  tmp  shell  3rd  
 INSERT   HOSTNAME  USER  …  tests  shell  3rd    INSERT   HOSTNAME  USER  …  tmp  shell  3rd  
 INSERT   HOSTNAME  USER  …  tests  shell  3rd  echo abc  INSERT   HOSTNAME  USER  …  tmp  shell  3rd  echo abc
abc abc
 INSERT   HOSTNAME  USER  …  tests  shell  3rd  false  INSERT   HOSTNAME  USER  …  tmp  shell  3rd  false
 INSERT   HOSTNAME  USER  …  tests  shell  3rd  set_theme_option default.segment_data.hostname.display false  INSERT   HOSTNAME  USER  …  tmp  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  USER  …  tmp  shell  3rd  set_theme_option default.segment_data.user.display false
 INSERT  …  tests  shell  3rd  select abc in def ghi jkl  INSERT  …  tmp  shell  3rd  select abc in def ghi jkl
 select                            do  select                          do
 select                             echo $abc  select                           echo $abc
 select                             break  select                           break
 select                            done  select                          done
1) def 2) ghi 3) jkl 1) def 2) ghi 3) jkl
                   Select variant  1                  Select variant  1
def def
 INSERT  …  tests  shell  3rd  cd .  INSERT  …  tmp  shell  3rd  cd .
 INSERT  …  tests  shell  3rd  cd .  INSERT  …  tmp  shell  3rd  cd .
 INSERT  …  tests  shell  3rd  set_theme_option default.segments.above "$ABOVE_LEFT"  INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above "$ABOVE_LEFT"
 INSERT  …  tests  shell  3rd  export DISPLAYED_ENV_VAR=foo  INSERT  …  tmp  shell  3rd  export DISPLAYED_ENV_VAR=foo
 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 "$ABOVE_FULL"  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                                                                                                                                                                                                                                                                                                        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  …  tmp  shell  3rd  set_theme_option default.segments.above
 INSERT  …  tests  shell  3rd  hash -d foo=$PWD:h ; cd .  INSERT  …  tmp  shell  3rd  hash -d foo=$PWD:h ; cd .
 INSERT  ~foo  3rd  set_theme_option default.dividers.left.hard \$ABC  INSERT  ~foo  3rd  set_theme_option default.dividers.left.hard \$ABC
 INSERT $ABC~foo  3rd $ABCtrue  INSERT $ABC~foo  3rd $ABCtrue

View File

@ -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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
[1] PID [1] PID
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1] + terminated bgscript.sh [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  ^[[32m  cd ../"$DIR2"
  HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  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 ../'`echo`'
  HOSTNAME  USER   BRANCH  …  shell  3rd  `echo`  cd ../'«Unicode!»'   HOSTNAME  USER   BRANCH  …  shell  3rd  `echo`  cd ../'«Unicode!»'
  HOSTNAME  USER   BRANCH  …  shell  3rd  «Unicode!»  cd ..   HOSTNAME  USER   BRANCH  …  shell  3rd  «Unicode!»  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bindkey -v ; set_theme default   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bindkey -v ; set_theme default
 INSERT   HOSTNAME  USER  …  tests  shell  3rd   COMMND   HOSTNAME  USER  …  tests  shell  3rd    INSERT   HOSTNAME  USER  …  tmp  shell  3rd   COMMND   HOSTNAME  USER  …  tmp  shell  3rd  
 INSERT   HOSTNAME  USER  …  tests  shell  3rd    INSERT   HOSTNAME  USER  …  tmp  shell  3rd  
 INSERT   HOSTNAME  USER  …  tests  shell  3rd  echo abc  INSERT   HOSTNAME  USER  …  tmp  shell  3rd  echo abc
abc abc
 INSERT   HOSTNAME  USER  …  tests  shell  3rd  false  INSERT   HOSTNAME  USER  …  tmp  shell  3rd  false
 INSERT   HOSTNAME  USER  …  tests  shell  3rd  set_theme_option default.segment_data.hostname.display false  INSERT   HOSTNAME  USER  …  tmp  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  USER  …  tmp  shell  3rd  set_theme_option default.segment_data.user.display false
 INSERT  …  tests  shell  3rd  select abc in def ghi jkl  INSERT  …  tmp  shell  3rd  select abc in def ghi jkl
 select  do  select  do
 select   echo $abc  select   echo $abc
 select   break  select   break
@ -34,19 +34,19 @@ abc
1) def 2) ghi 3) jkl 1) def 2) ghi 3) jkl
 Select variant  1  Select variant  1
def def
 INSERT  …  tests  shell  3rd  cd .  INSERT  …  tmp  shell  3rd  cd .
 INSERT  …  tests  shell  3rd  cd .  INSERT  …  tmp  shell  3rd  cd .
 INSERT  …  tests  shell  3rd  set_theme_option default.segments.above "$ABOVE_LEFT"  INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above "$ABOVE_LEFT"
 INSERT  …  tests  shell  3rd  export DISPLAYED_ENV_VAR=foo  INSERT  …  tmp  shell  3rd  export DISPLAYED_ENV_VAR=foo
 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 "$ABOVE_FULL"  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                                                                                                                                                                                                                                                                                                        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  …  tmp  shell  3rd  set_theme_option default.segments.above
 INSERT  …  tests  shell  3rd  hash -d foo=$PWD:h ; cd .  INSERT  …  tmp  shell  3rd  hash -d foo=$PWD:h ; cd .
 INSERT  ~foo  3rd  set_theme_option default.dividers.left.hard \$ABC  INSERT  ~foo  3rd  set_theme_option default.dividers.left.hard \$ABC
 INSERT $ABC~foo  3rd $ABCtrue  INSERT $ABC~foo  3rd $ABCtrue

View File

@ -1,41 +1,52 @@
  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  …  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment"   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV="/home/USER/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tests  shell  3rd  VIRTUAL_ENV=   HOSTNAME  USER  (e) some-virtual-environment   BRANCH  …  tmp  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bgscript.sh & waitpid.sh   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bgscript.sh & waitpid.sh
[1] PID [1] PID
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  false   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1] + terminated bgscript.sh [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  ^[[32m  cd ../"$DIR2"
  HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'   HOSTNAME  USER   BRANCH  …  shell  3rd  ^H  cd ../'\[\]'
  HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%'   HOSTNAME  USER   BRANCH  …  shell  3rd  \[\]  cd ../'%%'
  HOSTNAME  USER   BRANCH  …  shell  3rd  %%  cd ../'#[bold]'   HOSTNAME  USER   BRANCH  …  shell  3rd  %%  cd ../'#[bold]'
  HOSTNAME  USER   BRANCH  …  shell  3rd  #[bold]  cd ../'(echo)'   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 ../'`echo`'   HOSTNAME  USER   BRANCH  …  shell  3rd  $(echo)  cd ../'`echo`'
  HOSTNAME  USER   BRANCH  …  shell  3rd  `echo`  cd ../'«Unicode!»'   HOSTNAME  USER   BRANCH  …  shell  3rd  `echo`  cd ../'«Unicode!»'
  HOSTNAME  USER   BRANCH  …  shell  3rd  «Unicode!»  cd ..   HOSTNAME  USER   BRANCH  …  shell  3rd  «Unicode!»  cd ..
  HOSTNAME  USER   BRANCH  …  tests  shell  3rd  bindkey -v ; set_theme default   HOSTNAME  USER   BRANCH  …  tmp  shell  3rd  bindkey -v ; set_theme default
 INSERT   HOSTNAME  USER  …  tests  shell  3rd   COMMND   HOSTNAME  USER  …  tests  shell  3rd    INSERT   HOSTNAME  USER  …  tmp  shell  3rd   COMMND   HOSTNAME  USER  …  tmp  shell  3rd  
 INSERT   HOSTNAME  USER  …  tests  shell  3rd    INSERT   HOSTNAME  USER  …  tmp  shell  3rd  
 INSERT   HOSTNAME  USER  …  tests  shell  3rd  echo abc  INSERT   HOSTNAME  USER  …  tmp  shell  3rd  echo abc
abc abc
 INSERT   HOSTNAME  USER  …  tests  shell  3rd  false  INSERT   HOSTNAME  USER  …  tmp  shell  3rd  false
 INSERT   HOSTNAME  USER  …  tests  shell  3rd  set_theme_option default.segment_data.hostname.display false  INSERT   HOSTNAME  USER  …  tmp  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  USER  …  tmp  shell  3rd  set_theme_option default.segment_data.user.display false
 INSERT  …  tests  shell  3rd  select abc in def ghi jkl  INSERT  …  tmp  shell  3rd  select abc in def ghi jkl
 select                            do  select                          do
 select                             echo $abc  select                           echo $abc
 select                             break  select                           break
 select                            done  select                          done
1) def 2) ghi 3) jkl 1) def 2) ghi 3) jkl
                   Select variant  1                  Select variant  1
def def
 INSERT  …  tests  shell  3rd  cd .  INSERT  …  tmp  shell  3rd  cd .
 INSERT  …  tests  shell  3rd  cd .  INSERT  …  tmp  shell  3rd  cd .
 INSERT  …  tests  shell  3rd  hash -d foo=$PWD:h ; cd .  INSERT  …  tmp  shell  3rd  set_theme_option default.segments.above "$ABOVE_LEFT"
 INSERT  ~foo  3rd  set_theme_option default.dividers.left.hard \$ABC  INSERT  …  tmp  shell  3rd  export DISPLAYED_ENV_VAR=foo
 INSERT $ABC~foo  3rd $ABCtrue  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

View File

@ -1,6 +1,8 @@
set -e set -e
set -x
. tests/bot-ci/scripts/common/main.sh . tests/bot-ci/scripts/common/main.sh
zmodload zpython zmodload zpython || zmodload libzpython
zpython 'import zsh'
zpython 'import platform' zpython 'import platform'
zpython 'zsh.setvalue("ZSH_PYTHON_VERSION", platform.python_version())' zpython 'zsh.setvalue("ZSH_PYTHON_VERSION", platform.python_version())'
zpython 'zsh.setvalue("ZSH_PYTHON_IMPLEMENTATION", platform.python_implementation())' zpython 'zsh.setvalue("ZSH_PYTHON_IMPLEMENTATION", platform.python_implementation())'