Commits

Paul McLanahan committed 462d367

Modified the test runner to reliably use the intended shells.

  • Participants
  • Parent commits e41c876

Comments (0)

Files changed (2)

 # tox-created virtualenv.
 export VIRTUALENVWRAPPER_PYTHON="$envdir/bin/python"
 
-if [ -n "${ZSH_VERSION:-}" ]
-then
-    export SHELL=$(which zsh)
-fi
-
 # Run the test scripts with a little formatting around them to make it
 # easier to find where each script output starts.
-for test_script in $scripts
+for test_shell in bash ksh zsh
 do
-	echo
- 	echo '********************************************************************************'
-	echo "Running $test_script"
-    echo "  VIRTUAL_ENV=$VIRTUAL_ENV"
-    echo "  VIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON"
-    echo "    $($VIRTUALENVWRAPPER_PYTHON -V 2>&1)"
-    echo "  PYTHONPATH=$PYTHONPATH"
-    echo "  SHELL=$SHELL"
-	echo
-    export SHUNIT_PARENT="$test_script"
-	$test_script || exit 1
-	echo
+    test_shell_opts=
+    if [ $test_shell = "zsh" ]; then
+        test_shell_opts="-o shwordsplit"
+    fi
+    test_shell=$(which $test_shell)
+
+    for test_script in $scripts
+    do
+        echo
+        echo '********************************************************************************'
+        echo "Running $test_script"
+        echo "  VIRTUAL_ENV=$VIRTUAL_ENV"
+        echo "  VIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON"
+        echo "    $($VIRTUALENVWRAPPER_PYTHON -V 2>&1)"
+        echo "  PYTHONPATH=$PYTHONPATH"
+        echo "  SHELL=$test_shell"
+        echo
+        export SHUNIT_PARENT="$test_script"
+        $test_shell $test_shell_opts $test_script || exit 1
+        echo
+    done
 done
 
 exit 0
 envlist = py27,py26,py25,py24
 
 [testenv]
-commands = 
-  zsh -o shwordsplit ./tests/run_tests {envdir} []
-  ksh ./tests/run_tests {envdir} []
-  bash ./tests/run_tests {envdir} []
+commands = bash ./tests/run_tests {envdir} []
 
 # Not sure why this is needed, but on my system if it isn't included then
 # the python version picked up for 2.6 is actually 2.7.
 # IF THIS CAUSES YOU A PROBLEM COMMENT IT OUT BEFORE RUNNING THE TESTS.
 [testenv:py26]
-basepython=/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
+basepython=/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6