Commits

Doug Hellmann committed 32959f2

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

Comments (0)

Files changed (1)

 
 # Make sure the test shells exist before proceeding, otherwise tests are
 # going to fail later.
+DESIRED_SHELLS=${DESIRED_SHELLS:-"bash zsh ksh"}
 missing_shells=""
 test_shells=""
-for shell in bash ksh zsh
+for shell in $DESIRED_SHELLS
 do
     if test_shell=$(which $shell); then
         test_shells="$test_shells $test_shell"
 
     for test_shell in $test_shells
     do
+        unset BASH
+        unset ZSH_VERSION
         test_shell_opts=
         case /$test_shell in
             */zsh) test_shell_opts="-o shwordsplit" ;;
         esac
         export test_shell
+        export SHELL=$(which $test_shell)
 
         echo
         echo '********************************************************************************'