Skip to content

Commit 89a2e39

Browse files
committed
allow the caller to control which shells are used for tests; unset variables that might be inherited and give the wrong idea about what the current shell is for a test; export SHELL to point to the current shell
1 parent 62a8b8b commit 89a2e39

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/run_tests

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ fi
2323

2424
# Make sure the test shells exist before proceeding, otherwise tests are
2525
# going to fail later.
26+
DESIRED_SHELLS=${DESIRED_SHELLS:-"bash zsh ksh"}
2627
missing_shells=""
2728
test_shells=""
28-
for shell in bash ksh zsh
29+
for shell in $DESIRED_SHELLS
2930
do
3031
if test_shell=$(which $shell); then
3132
test_shells="$test_shells $test_shell"
@@ -69,11 +70,14 @@ do
6970

7071
for test_shell in $test_shells
7172
do
73+
unset BASH
74+
unset ZSH_VERSION
7275
test_shell_opts=
7376
case /$test_shell in
7477
*/zsh) test_shell_opts="-o shwordsplit" ;;
7578
esac
7679
export test_shell
80+
export SHELL=$(which $test_shell)
7781

7882
echo
7983
echo '********************************************************************************'

0 commit comments

Comments
 (0)