Skip to content

Commit

Permalink
Bug #694890: run_tests.sh sometimes doesn't pass arguments to nosetest
Browse files Browse the repository at this point in the history
Change the argument parsing in run_tests.sh so that we explicitly gather
the arguments that aren't meant for run_tests.sh, and pass them on to
nosetests.
  • Loading branch information
Ewan Mellor authored and Tarmac committed Dec 28, 2010
2 parents d3d0e85 + 821fc6b commit 675ca7c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions run_tests.sh
Expand Up @@ -21,6 +21,7 @@ function process_option {
-V|--virtual-env) let always_venv=1; let never_venv=0;;
-N|--no-virtual-env) let always_venv=0; let never_venv=1;;
-f|--force) let force=1;;
*) noseargs="$noseargs $1"
esac
}

Expand All @@ -29,15 +30,18 @@ with_venv=tools/with_venv.sh
always_venv=0
never_venv=0
force=0
noseargs=

for arg in "$@"; do
process_option $arg
done

NOSETESTS="nosetests -v $noseargs"

if [ $never_venv -eq 1 ]; then
# Just run the test suites in current environment
rm -f nova.sqlite
nosetests -v
$NOSETESTS
exit
fi

Expand All @@ -49,7 +53,7 @@ fi

if [ -e ${venv} ]; then
${with_venv} rm -f nova.sqlite
${with_venv} nosetests -v $@
${with_venv} $NOSETESTS
else
if [ $always_venv -eq 1 ]; then
# Automatically install the virtualenv
Expand All @@ -62,10 +66,10 @@ else
python tools/install_venv.py
else
rm -f nova.sqlite
nosetests -v
$NOSETESTS
exit
fi
fi
${with_venv} rm -f nova.sqlite
${with_venv} nosetests -v $@
${with_venv} $NOSETESTS
fi

0 comments on commit 675ca7c

Please sign in to comment.