Add option to exclude pep8 examination to run_test.sh.

Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
This commit is contained in:
Jeff Peeler 2012-05-08 14:41:21 -04:00
parent d8b3a3387b
commit ee2076b2aa

View File

@ -9,6 +9,7 @@ function usage {
echo " -f, --force Force a clean re-build of the virtual environment. Useful when dependencies have been added." echo " -f, --force Force a clean re-build of the virtual environment. Useful when dependencies have been added."
echo " --unittests-only Run unit tests only." echo " --unittests-only Run unit tests only."
echo " -p, --pep8 Just run pep8" echo " -p, --pep8 Just run pep8"
echo " -P, --no-pep8 Don't run static code checks"
echo " -c, --coverage Generate coverage report" echo " -c, --coverage Generate coverage report"
echo " -h, --help Print this usage message" echo " -h, --help Print this usage message"
echo "" echo ""
@ -25,6 +26,7 @@ function process_option {
-f|--force) let force=1;; -f|--force) let force=1;;
--unittests-only) noseargs="$noseargs -a tag=unit";; --unittests-only) noseargs="$noseargs -a tag=unit";;
-p|--pep8) let just_pep8=1;; -p|--pep8) let just_pep8=1;;
-P|--no-pep8) no_pep8=1;;
-c|--coverage) coverage=1;; -c|--coverage) coverage=1;;
-h|--help) usage;; -h|--help) usage;;
*) noseargs="$noseargs $1" *) noseargs="$noseargs $1"
@ -39,6 +41,7 @@ force=0
noseargs= noseargs=
wrapper="" wrapper=""
just_pep8=0 just_pep8=0
no_pep8=0
coverage=0 coverage=0
for arg in "$@"; do for arg in "$@"; do
@ -96,15 +99,21 @@ if [ $coverage -eq 1 ]; then
${wrapper} coverage erase ${wrapper} coverage erase
fi fi
run_tests
if [ $just_pep8 -eq 1 ]; then if [ $just_pep8 -eq 1 ]; then
run_pep8 run_pep8
exit exit
fi fi
run_tests
# NOTE(sirp): we only want to run pep8 when we're running the full-test suite,
# not when we're running tests individually. To handle this, we need to
# distinguish between options (noseopts), which begin with a '-', and
# arguments (noseargs).
if [ -z "$noseargs" ]; then if [ -z "$noseargs" ]; then
run_pep8 if [ $no_pep8 -eq 0 ]; then
run_pep8
fi
fi fi
if [ $coverage -eq 1 ]; then if [ $coverage -eq 1 ]; then