diff options
-rwxr-xr-x | bin/_flake | 3 | ||||
-rwxr-xr-x | bin/runtests | 14 |
2 files changed, 11 insertions, 6 deletions
diff --git a/bin/_flake b/bin/_flake new file mode 100755 index 0000000..bb5bf3f --- /dev/null +++ b/bin/_flake @@ -0,0 +1,3 @@ +#!/bin/bash + +flake8 . --exclude=./okupy/tests/settings.py,./okupy/settings,setup.py,.virtualenv diff --git a/bin/runtests b/bin/runtests index 1ea3b7a..8284ddd 100755 --- a/bin/runtests +++ b/bin/runtests @@ -1,23 +1,25 @@ #!/bin/bash -while getopts sdcf2 arg; do +while getopts dcf2v: arg; do case ${arg} in - s) SETTINGS="--settings=okupy.tests.settings" ;; d) TDAEMON="tdaemon -t django" ;; c) COVERAGE="coverage" ;; - f) FLAKE8="flake8 . --exclude=./okupy/tests/settings.py,./okupy/settings,setup.py" ;; + f) FLAKE8="flake8 . --exclude=./okupy/tests/settings.py,./okupy/settings,setup.py,.virtualenv" ;; 2) SUFFIX="2" ;; + v) VERBOSE="-v ${OPTARG}" ;; esac done +ARGS="--settings=okupy.tests.settings --traceback ${VERBOSE}" + if [[ -n ${TDAEMON} ]]; then [[ -n ${COVERAGE} ]] && COVERAGE="-c" - ${TDAEMON} ${COVERAGE} --custom-args="${SETTINGS} ${*:${OPTIND}}" + ${TDAEMON} ${COVERAGE} --custom-args="${ARGS} ${*:${OPTIND}}" elif [[ -n ${COVERAGE} ]]; then - ${COVERAGE} run manage.py test --traceback ${SETTINGS} "${@:${OPTIND}}" + ${COVERAGE} run manage.py test ${ARGS} "${@:${OPTIND}}" ${COVERAGE} report -m else - COMMAND="python${SUFFIX} manage.py test --traceback ${SETTINGS} ${*:${OPTIND}}" + COMMAND="python${SUFFIX} manage.py test ${ARGS} ${*:${OPTIND}}" echo "Executing: $COMMAND" $COMMAND fi |