Compare commits

...

4 Commits

Author SHA1 Message Date
Thomas Levine
560b55d1fb TEST_SHELL 2014-11-17 04:49:23 +00:00
Thomas Levine
6f51dd7abb more urchin -x tests 2014-11-17 04:44:51 +00:00
Thomas Levine
284077d1a1 fix the test 2014-11-16 22:40:36 +00:00
Thomas Levine
3470e4b979 moving tests 2014-11-16 22:26:54 +00:00
8 changed files with 20 additions and 5 deletions

View File

@ -0,0 +1,4 @@
#! ../../../urchin -x
running=$(ps -o comm= -p $$ && :)
echo "Running shell: $running"
[ "$running" = bash ]

View File

@ -0,0 +1,3 @@
#!/bin/sh
export TEST_SHELL=/bin/zsh
echo '[ "$TEST_SHELL" = /bin/zsh ] ; exit $?' | ../../urchin -x

View File

@ -0,0 +1,3 @@
#!/bin/sh
test c = $(../../urchin -x .print-arg-3 a 'b b b b' c d e)

View File

@ -0,0 +1,3 @@
#!/bin/sh
export TEST_SHELL=/bin/zsh
echo 'test -n "$ZSH_VERSION"; exit $?' | ../../urchin -x

View File

@ -0,0 +1,3 @@
#!/bin/sh
export TEST_SHELL=/bin/bash
../../urchin .test-urchin-x

View File

@ -1,3 +0,0 @@
#!/bin/sh
test c = $(../urchin -x .print-arg-3 a 'b b b b' c d e)

6
urchin
View File

@ -177,8 +177,10 @@ do
;;
-x) # `urchin -sh` is equivalent to "$TEST_SHELL"
shift
urchinsh=${TEST_SHELL:-/bin/sh}
"$urchinsh" "$@"
#current_shell=$(ps -o comm= -p $$ && :)
#urchinsh=${TEST_SHELL:-$current_shell}
export TEST_SHELL=${TEST_SHELL:-/bin/sh}
"$TEST_SHELL" "$@"
exit $?;;
-h|--help) urchin_help
exit 0;;