Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rationalized runtests.sh
  • Loading branch information
Chris Glass committed Jan 10, 2011
1 parent 9bcea67 commit e434850
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions runtests.sh
Expand Up @@ -8,8 +8,7 @@ index=0
reuse_env=true
disable_coverage=true
django_trunk=false
python=`python -c "import sys; print '.'.join([str(x) for x in sys.version_info[:2]])"`

python="python" # to ensure this script works if no python option is specified
while [ "$index" -lt "$num_args" ]
do
case "${args[$index]}" in
Expand Down Expand Up @@ -46,7 +45,7 @@ do
echo " --with-coverage - enables coverage"
echo " --rebuild-env - run buildout before the tests"
echo " --django-trunk - run tests against django trunk"
echo " --python X.X - python version to use to run the tests"
echo " --python /path/to/python - python version to use to run the tests"
exit 1
;;

Expand All @@ -56,29 +55,11 @@ do
let "index = $index + 1"
done

current_buildout_django=`cat .installed.cfg | grep "^version = " | sed s/'version = '//`
current_buildout_python=`head -n 1 bin/buildout | sed s/[^0-9\.]//g`

python_path="/usr/bin/python$python"

echo "using python $python"

if [ $reuse_env == true ]; then
if [[ $django_trunk == true && $current_buildout_django != 'trunk' ]]; then
reuse_env=false
else
if [[ $django_trunk == false && $current_buildout_django != '1.2.4' ]]; then
reuse_env=false
fi
fi
if [[ $python != $current_buildout_python ]]; then
reuse_env=false
fi
fi
echo "using python at: $python"

if [ $reuse_env == false ]; then
echo "setting up test environment (this might take a while)..."
$python_path bootstrap.py
$python bootstrap.py
if [ $? != 0 ]; then
echo "bootstrap.py failed"
exit 1
Expand Down

0 comments on commit e434850

Please sign in to comment.