Add tcsh tests

This commit is contained in:
ZyX 2014-01-26 23:52:06 +04:00
parent 219b81d23d
commit fe99e252e9
9 changed files with 52 additions and 8 deletions

View File

@ -9,7 +9,7 @@ if python -c 'import sys; sys.exit(1 * (sys.version_info[0] != 2))' ; then
pip install unittest2 argparse
fi
fi
sudo apt-get install -qq screen zsh
sudo apt-get install -qq screen zsh tcsh
# Travis has too outdated fish. It cannot be used for tests.
# sudo apt-get install fish
true

View File

@ -2,11 +2,11 @@
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  ⓔ  some-virtual-environment   BRANCH  ⋯  tests  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  bash -c "echo \$\$>pid ; while true ; do sleep 0.1s ; done" &
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done' &
[1] PID
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1]+ Terminated bash -c "echo \$\$>pid ; while true ; do sleep 0.1s ; done"
[1]+ Terminated bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done'
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  cd "$DIR1"
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  ^[[32m  cd ../"$DIR2"
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  ^H  cd ../'\[\]'

View File

@ -7,7 +7,7 @@ cd .git
cd ..
VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
VIRTUAL_ENV=
bash -c "echo \$\$>pid ; while true ; do sleep 0.1s ; done" &
bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done' &
false
kill `cat pid` ; sleep 1s
cd "$DIR1"

View File

@ -8,7 +8,7 @@ cd .git
cd ..
set VIRTUAL_ENV "$HOME/.virtenvs/some-virtual-environment"
set VIRTUAL_ENV
bash -c "echo \$\$>pid ; while true ; do sleep 0.1s ; done" &
bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done' &
false
kill (cat pid) ; sleep 1s
cd "$DIR1"

View File

@ -0,0 +1,21 @@
setenv POWERLINE_COMMAND $PWD:q/scripts/powerline" -p "$PWD:q/powerline/config_files" -t default_leftonly.segment_data.hostname.args.only_if_ssh=false -c ext.shell.theme=default_leftonly"
unsetenv VIRTUAL_ENV
source powerline/bindings/tcsh/powerline.tcsh ; cd tests/shell/3rd
cd .git
cd ..
setenv VIRTUAL_ENV $HOME:q"/.virtenvs/some-virtual-environment"
unsetenv VIRTUAL_ENV
bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done' &
false # Warning: currently tcsh bindings do not support job count
kill `cat pid` ; sleep 1s
cd $DIR1:q
cd ../$DIR2:q
cd ../'\[\]'
cd ../'%%'
cd ../'#[bold]'
cd ../'(echo)'
cd ../'$(echo)'
cd ../'`echo`'
false
true is the last line
exit

View File

@ -8,7 +8,7 @@ cd .git
cd ..
VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
VIRTUAL_ENV=
bash -c "echo \$\$>pid ; while true ; do sleep 0.1s ; done" &
bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done' &
false
kill `cat pid` ; sleep 1s
cd "$DIR1"

19
tests/test_shells/tcsh.ok Normal file
View File

@ -0,0 +1,19 @@
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd    cd .git
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  .git    cd ..
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd    setenv VIRTUAL_ENV $HOME:q"/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  ⓔ  some-virtual-environment   BRANCH  ⋯  tests  shell  3rd    unsetenv VIRTUAL_ENV
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd    bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done' &
[1] PID
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd    false # Warning: currently tcsh bindings do not support job count
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1    kill `cat pid` ; sleep 1s
[1] + Terminated bash -c echo $$>pid ; while true ; do sleep 0.1s ; done
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd    cd $DIR1:q
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  ^[[32m    cd ../$DIR2:q
  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`    false

View File

@ -86,5 +86,9 @@ if ! run_test fish -i ; then
FAILED=1
fi
if ! run_test tcsh -f -i ; then
FAILED=1
fi
test "x$ONLY_SHELL" = "x" && rm -r tests/shell
exit $FAILED

View File

@ -3,11 +3,11 @@
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  .git  cd ..
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  VIRTUAL_ENV="$HOME/.virtenvs/some-virtual-environment"
  HOSTNAME  USER  ⓔ  some-virtual-environment   BRANCH  ⋯  tests  shell  3rd  VIRTUAL_ENV=
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  bash -c "echo \$\$>pid ; while true ; do sleep 0.1s ; done" &
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done' &
[1] PID
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  false
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  1  1  kill `cat pid` ; sleep 1s
[1] + terminated bash -c "echo \$\$>pid ; while true ; do sleep 0.1s ; done"
[1] + terminated bash -c 'echo $$>pid ; while true ; do sleep 0.1s ; done'
  HOSTNAME  USER   BRANCH  ⋯  tests  shell  3rd  cd "$DIR1"
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  ^[[32m  cd ../"$DIR2"
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  ^H  cd ../'\[\]'