diff --git a/tests/.print-arg-3 b/tests/.print-arg-3 new file mode 100644 index 0000000..09e6cfe --- /dev/null +++ b/tests/.print-arg-3 @@ -0,0 +1 @@ +echo $3 diff --git a/tests/urchin -sh should start the $TEST_SHELL. b/tests/urchin -sh should start the $TEST_SHELL. deleted file mode 100755 index daaf23e..0000000 --- a/tests/urchin -sh should start the $TEST_SHELL. +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -test c = $(echo 'echo $3' | ../urchin -sh a 'b b b b' c d e) diff --git a/tests/urchin -x should start the $TEST_SHELL. b/tests/urchin -x should start the $TEST_SHELL. new file mode 100755 index 0000000..e137df2 --- /dev/null +++ b/tests/urchin -x should start the $TEST_SHELL. @@ -0,0 +1,3 @@ +#!/bin/sh + +test c = $(../urchin -x .print-arg-3 a 'b b b b' c d e) diff --git a/urchin b/urchin index b799910..099f43c 100755 --- a/urchin +++ b/urchin @@ -102,6 +102,8 @@ urchin_help() { echo ' shebang line "#!/bin/sh" with the specified shell.' echo '-f Force running even if the test directory'\''s name does not' echo ' contain the word "test".' + echo '-x Run "$TEST_SHELL", falling back on /bin/sh. This might be' + echo ' useful in the shebang line (experimental).' echo '-h This help.' # echo # echo '--xsd Output xUnit XML schema for an integration server.' @@ -175,7 +177,8 @@ do shell_for_sh_tests=$1 which "$shell_for_sh_tests" >/dev/null || { echo "Cannot find specified shell: '$shell_for_sh_tests'" >&2; urchin_help >&2; exit 2; } ;; - -sh) # `urchin -sh` is equivalent to "$TEST_SHELL" + -x) # `urchin -sh` is equivalent to "$TEST_SHELL" + shift urchinsh=${TEST_SHELL:-/bin/sh} "$urchinsh" "$@" exit $?;;