22
33# set -x
44
5- if [ -z " $TOXIC " ]
6- then
7- echo " Only run this via tox" 1>&2
8- exit 1
9- fi
10-
115envdir=" $1 "
126shift
137scripts=" $* "
2115 fi
2216fi
2317
24- # Make sure the test shells exist before proceeding, otherwise tests are
25- # going to fail later.
26- DESIRED_SHELLS=${DESIRED_SHELLS:- " bash zsh ksh" }
27- missing_shells=" "
28- test_shells=" "
29- for shell in $DESIRED_SHELLS
30- do
31- if test_shell=$( which $shell ) ; then
32- test_shells=" $test_shells $test_shell "
33- else
34- missing_shells=" $missing_shells $shell "
35- fi
36- done
37- if [ -n " $missing_shells " ]
38- then
39- echo " Couldn't find the following shells: $missing_shells " 1>&2
40- exit 1
41- fi
42-
4318# Force the tox virtualenv to be active.
4419#
4520# Since this script runs from within a separate shell created by tox,
4823# are *not* inherited.
4924#
5025source " $envdir /bin/activate"
26+ TMPDIR=" $envdir /tmp"
27+ export TMPDIR
28+ mkdir -p " $TMPDIR "
5129
5230# Set up virtualenvwrapper.hook_loader to print more details than usual for debugging.
5331# export HOOK_VERBOSE_OPTION=-vvv
54- export HOOK_VERBOSE_OPTION=" -q"
32+ HOOK_VERBOSE_OPTION=" -q"
33+ export HOOK_VERBOSE_OPTION
5534
5635# Force virtualenvwrapper to use the python interpreter in the
5736# tox-created virtualenv.
58- export VIRTUALENVWRAPPER_PYTHON=" $envdir /bin/python"
37+ VIRTUALENVWRAPPER_PYTHON=" $envdir /bin/python"
38+ export VIRTUALENVWRAPPER_PYTHON
5939
6040# Clear any user settings for the hook directory or log directory
6141unset VIRTUALENVWRAPPER_HOOK_DIR
@@ -68,31 +48,24 @@ unset VIRTUALENVWRAPPER_VIRTUALENV_ARGS
6848for test_script in $scripts
6949do
7050
71- for test_shell in $test_shells
72- do
73- unset BASH
74- unset ZSH_VERSION
75- test_shell_opts=
76- case /$test_shell in
77- * /zsh) test_shell_opts=" -o shwordsplit" ;;
78- esac
79- export test_shell
80- export SHELL=$( which $test_shell )
51+ echo
52+ echo ' ********************************************************************************'
53+ echo " Running $test_script "
54+ echo " VIRTUAL_ENV=$VIRTUAL_ENV "
55+ echo " VIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON "
56+ echo " $( $VIRTUALENVWRAPPER_PYTHON -V 2>&1 ) "
57+ echo " PYTHONPATH=$PYTHONPATH "
58+ echo " SHELL=$SHELL "
59+ echo " BASH_VERSION=$BASH_VERSION "
60+ echo " ZSH_VERSION=$ZSH_VERSION "
61+ echo " KSH_VERSION=$KSH_VERSION "
62+ echo " virtualenv=$( which virtualenv) "
63+ echo
64+ SHUNIT_PARENT=" $test_script "
65+ export SHUNIT_PARENT
66+ $test_shell_opts $test_script || exit 1
67+ echo
8168
82- echo
83- echo ' ********************************************************************************'
84- echo " Running $test_script "
85- echo " VIRTUAL_ENV=$VIRTUAL_ENV "
86- echo " VIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON "
87- echo " $( $VIRTUALENVWRAPPER_PYTHON -V 2>&1 ) "
88- echo " PYTHONPATH=$PYTHONPATH "
89- echo " SHELL=$test_shell "
90- echo " virtualenv=$( which virtualenv) "
91- echo
92- export SHUNIT_PARENT=" $test_script "
93- $test_shell $test_shell_opts $test_script || exit 1
94- echo
95- done
9669done
9770
9871exit 0
0 commit comments