From ee2076b2aa33cf1f3248e8d1052f52bd723762ac Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Tue, 8 May 2012 14:41:21 -0400 Subject: [PATCH] Add option to exclude pep8 examination to run_test.sh. Signed-off-by: Jeff Peeler --- run_tests.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index e9e3dcd8..df569c3c 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -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 " --unittests-only Run unit tests only." echo " -p, --pep8 Just run pep8" + echo " -P, --no-pep8 Don't run static code checks" echo " -c, --coverage Generate coverage report" echo " -h, --help Print this usage message" echo "" @@ -25,6 +26,7 @@ function process_option { -f|--force) let force=1;; --unittests-only) noseargs="$noseargs -a tag=unit";; -p|--pep8) let just_pep8=1;; + -P|--no-pep8) no_pep8=1;; -c|--coverage) coverage=1;; -h|--help) usage;; *) noseargs="$noseargs $1" @@ -39,6 +41,7 @@ force=0 noseargs= wrapper="" just_pep8=0 +no_pep8=0 coverage=0 for arg in "$@"; do @@ -96,15 +99,21 @@ if [ $coverage -eq 1 ]; then ${wrapper} coverage erase fi -run_tests - if [ $just_pep8 -eq 1 ]; then run_pep8 exit 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 - run_pep8 + if [ $no_pep8 -eq 0 ]; then + run_pep8 + fi fi if [ $coverage -eq 1 ]; then -- 2.45.2